feat: add event to course signup button
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
import PaymentModal from './PaymentModal.svelte';
|
import PaymentModal from './PaymentModal.svelte';
|
||||||
import type { Course } from '$lib/utils/types';
|
import type { Course } from '$lib/utils/types';
|
||||||
import { ROLE } from '$lib/utils/constants/roles';
|
import { ROLE } from '$lib/utils/constants/roles';
|
||||||
|
import { capturePosthogEvent } from '$lib/utils/services/posthog';
|
||||||
|
|
||||||
export let className = '';
|
export let className = '';
|
||||||
export let editMode = false;
|
export let editMode = false;
|
||||||
@@ -31,6 +32,12 @@
|
|||||||
function handleJoinCourse() {
|
function handleJoinCourse() {
|
||||||
if (editMode) return;
|
if (editMode) return;
|
||||||
|
|
||||||
|
capturePosthogEvent('join_course', {
|
||||||
|
course_id: courseData.id,
|
||||||
|
course_title: courseData.title,
|
||||||
|
course_cost: courseData.cost,
|
||||||
|
course_free: isFree
|
||||||
|
});
|
||||||
if (isFree) {
|
if (isFree) {
|
||||||
const link = getStudentInviteLink(courseData, $currentOrg.siteName);
|
const link = getStudentInviteLink(courseData, $currentOrg.siteName);
|
||||||
goto(link);
|
goto(link);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
NOTIFICATION_NAME
|
NOTIFICATION_NAME
|
||||||
} from '$lib/utils/services/notification/notification';
|
} from '$lib/utils/services/notification/notification';
|
||||||
import { snackbar } from '$lib/components/Snackbar/store.js';
|
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;
|
export let data;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user