fix: events

This commit is contained in:
Chirag Aggarwal
2025-06-26 16:07:10 +05:30
parent 177eaa3e4d
commit c01d9a54ff
3 changed files with 12 additions and 4 deletions
@@ -32,7 +32,11 @@
}
if (data?.couponData?.code) {
trackEvent(Submit.AccountCreate, { campaign_name: data?.couponData?.code });
trackEvent(Submit.AccountCreate, {
campaign_name: data?.couponData?.code,
email: mail,
name: $user?.name
});
await goto(`${base}/apply-credit?code=${data?.couponData?.code}`);
return;
}
@@ -32,7 +32,11 @@
await sdk.forConsole.account.create(ID.unique(), mail, pass, name ?? '');
await sdk.forConsole.account.createEmailPasswordSession(mail, pass);
trackEvent(Submit.AccountCreate, { campaign_name: data?.couponData?.code });
trackEvent(Submit.AccountCreate, {
campaign_name: data?.couponData?.code,
email: mail,
name: name
});
if (data?.couponData?.code) {
await goto(`${base}/apply-credit?code=${data?.couponData?.code}`);
@@ -13,7 +13,7 @@
import { sdk } from '$lib/stores/sdk';
import { Unauthenticated } from '$lib/layout';
import { Dependencies } from '$lib/constants';
import { trackEvent } from '$lib/actions/analytics';
import { Submit, trackEvent } from '$lib/actions/analytics';
import { onMount } from 'svelte';
import { page } from '$app/state';
import LoginLight from '$lib/images/login/login-light-mode.svg';
@@ -77,7 +77,7 @@
await sdk.forConsole.account.updatePrefs(newPrefs);
await invalidate(Dependencies.ACCOUNT);
await goto(base);
trackEvent('submit_account_create', {
trackEvent(Submit.AccountCreate, {
email: mail,
name: name,
code: code