diff --git a/src/components/SQLCourse/BuyButton.tsx b/src/components/SQLCourse/BuyButton.tsx index 2a314a479..917f7a1b8 100644 --- a/src/components/SQLCourse/BuyButton.tsx +++ b/src/components/SQLCourse/BuyButton.tsx @@ -1,5 +1,5 @@ import { useMutation, useQuery } from '@tanstack/react-query'; -import { ArrowRightIcon, BookOpen, Play } from 'lucide-react'; +import { ArrowRightIcon, MousePointerClick, Play } from 'lucide-react'; import { useEffect, useState } from 'react'; import { cn } from '../../lib/classname'; import { @@ -178,7 +178,15 @@ export function BuyButton(props: BuyButtonProps) { return; } - window.location.href = `${import.meta.env.PUBLIC_COURSE_APP_URL}/${SQL_COURSE_SLUG}`; + window?.fireEvent({ + action: `${SQL_COURSE_SLUG}_demo_started`, + category: 'course', + label: `${SQL_COURSE_SLUG} Course Demo Started`, + }); + + setTimeout(() => { + window.location.href = `${import.meta.env.PUBLIC_COURSE_APP_URL}/${SQL_COURSE_SLUG}`; + }, 200); } const courseLoginPopup = isLoginPopupOpen && ( @@ -195,7 +203,7 @@ export function BuyButton(props: BuyButtonProps) { onClose={() => setIsVideoModalOpen(false)} /> )} -