Skip to content

Commit a4f6e45

Browse files
authored
Merge pull request #2048 from appwrite/track-name-email
2 parents 9b698e7 + 4b839ac commit a4f6e45

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

src/routes/(public)/(guest)/login/+page.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
}
3333
3434
if (data?.couponData?.code) {
35-
trackEvent(Submit.AccountCreate, { campaign_name: data?.couponData?.code });
35+
trackEvent(Submit.AccountCreate, {
36+
campaign_name: data?.couponData?.code,
37+
email: mail,
38+
name: $user?.name
39+
});
3640
await goto(`${base}/apply-credit?code=${data?.couponData?.code}`);
3741
return;
3842
}

src/routes/(public)/(guest)/register/+page.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
await sdk.forConsole.account.create(ID.unique(), mail, pass, name ?? '');
3333
await sdk.forConsole.account.createEmailPasswordSession(mail, pass);
3434
35-
trackEvent(Submit.AccountCreate, { campaign_name: data?.couponData?.code });
35+
trackEvent(Submit.AccountCreate, {
36+
campaign_name: data?.couponData?.code,
37+
email: mail,
38+
name: name
39+
});
3640
3741
if (data?.couponData?.code) {
3842
await goto(`${base}/apply-credit?code=${data?.couponData?.code}`);

src/routes/(public)/(guest)/register/invite/[slug]/+page.svelte

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import { sdk } from '$lib/stores/sdk';
1414
import { Unauthenticated } from '$lib/layout';
1515
import { Dependencies } from '$lib/constants';
16-
import { trackEvent } from '$lib/actions/analytics';
16+
import { Submit, trackEvent } from '$lib/actions/analytics';
1717
import { onMount } from 'svelte';
1818
import { page } from '$app/state';
1919
import LoginLight from '$lib/images/login/login-light-mode.svg';
@@ -74,10 +74,16 @@
7474
await sdk.forConsole.account.createEmailPasswordSession(mail, pass);
7575
const prefs = await sdk.forConsole.account.getPrefs();
7676
const newPrefs = { ...prefs, code };
77-
await sdk.forConsole.account.updatePrefs(newPrefs);
78-
await invalidate(Dependencies.ACCOUNT);
77+
await Promise.all([
78+
sdk.forConsole.account.updatePrefs(newPrefs),
79+
invalidate(Dependencies.ACCOUNT)
80+
]);
7981
await goto(base);
80-
trackEvent('submit_account_create', { code: code });
82+
trackEvent(Submit.AccountCreate, {
83+
email: mail,
84+
name: name,
85+
code: code
86+
});
8187
}
8288
} catch (error) {
8389
addNotification({

0 commit comments

Comments
 (0)