feat: add event to course signup button

This commit is contained in:
Rotimi Best
2023-11-09 03:49:21 +00:00
parent 439b22ac79
commit d2fb5db8d7
2 changed files with 8 additions and 1 deletions
@@ -9,6 +9,7 @@
import PaymentModal from './PaymentModal.svelte';
import type { Course } from '$lib/utils/types';
import { ROLE } from '$lib/utils/constants/roles';
import { capturePosthogEvent } from '$lib/utils/services/posthog';
export let className = '';
export let editMode = false;
@@ -31,6 +32,12 @@
function handleJoinCourse() {
if (editMode) return;
capturePosthogEvent('join_course', {
course_id: courseData.id,
course_title: courseData.title,
course_cost: courseData.cost,
course_free: isFree
});
if (isFree) {
const link = getStudentInviteLink(courseData, $currentOrg.siteName);
goto(link);
+1 -1
View File
@@ -15,7 +15,7 @@
NOTIFICATION_NAME
} from '$lib/utils/services/notification/notification';
import { snackbar } from '$lib/components/Snackbar/store.js';
import { capturePosthogEvent } from '$lib/utils/services/posthog/index.js';
import { capturePosthogEvent } from '$lib/utils/services/posthog';
export let data;