From 86be2265178e986200d916a608631172dd29db8c Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 13:07:03 +0100 Subject: [PATCH 01/34] Fix login event --- src/routes/(authenticated)/mfa/+page.svelte | 2 ++ src/routes/(public)/(guest)/login/+page.svelte | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/(authenticated)/mfa/+page.svelte b/src/routes/(authenticated)/mfa/+page.svelte index 693893280..97592703e 100644 --- a/src/routes/(authenticated)/mfa/+page.svelte +++ b/src/routes/(authenticated)/mfa/+page.svelte @@ -10,6 +10,7 @@ import { addNotification } from '$lib/stores/notifications.js'; import { Icon, Layout } from '@appwrite.io/pink-svelte'; import { IconChevronLeft } from '@appwrite.io/pink-icons-svelte'; + import { Submit, trackEvent } from '$lib/actions/analytics'; export let data; @@ -28,6 +29,7 @@ disabled = true; try { await verify(challenge, code); + trackEvent(Submit.AccountLogin); if ($page.url.searchParams) { const redirect = $page.url.searchParams.get('redirect'); $page.url.searchParams.delete('redirect'); diff --git a/src/routes/(public)/(guest)/login/+page.svelte b/src/routes/(public)/(guest)/login/+page.svelte index 7986a7023..2bde63340 100644 --- a/src/routes/(public)/(guest)/login/+page.svelte +++ b/src/routes/(public)/(guest)/login/+page.svelte @@ -22,8 +22,8 @@ disabled = true; await sdk.forConsole.account.createEmailPasswordSession(mail, pass); await invalidate(Dependencies.ACCOUNT); - trackEvent(Submit.AccountLogin); if ($user) { + trackEvent(Submit.AccountLogin); addNotification({ type: 'success', message: 'Successfully logged in.' From d6a82eac152447168a3365bbb75a0d20d8b0ddcd Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 13:07:54 +0100 Subject: [PATCH 02/34] Add mfa tracking --- src/routes/(authenticated)/mfa/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(authenticated)/mfa/+page.svelte b/src/routes/(authenticated)/mfa/+page.svelte index 97592703e..6ac599f0c 100644 --- a/src/routes/(authenticated)/mfa/+page.svelte +++ b/src/routes/(authenticated)/mfa/+page.svelte @@ -29,7 +29,7 @@ disabled = true; try { await verify(challenge, code); - trackEvent(Submit.AccountLogin); + trackEvent(Submit.AccountLogin, { mfa: true }); if ($page.url.searchParams) { const redirect = $page.url.searchParams.get('redirect'); $page.url.searchParams.delete('redirect'); From 36dfc62a1ed6bb57eb27c39d46352fbb089e8d2d Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 13:09:25 +0100 Subject: [PATCH 03/34] Add mfa tracking --- src/routes/(authenticated)/mfa/+page.svelte | 2 +- src/routes/(public)/(guest)/login/+page.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/(authenticated)/mfa/+page.svelte b/src/routes/(authenticated)/mfa/+page.svelte index 6ac599f0c..c3d12e33d 100644 --- a/src/routes/(authenticated)/mfa/+page.svelte +++ b/src/routes/(authenticated)/mfa/+page.svelte @@ -29,7 +29,7 @@ disabled = true; try { await verify(challenge, code); - trackEvent(Submit.AccountLogin, { mfa: true }); + trackEvent(Submit.AccountLogin, { mfa_used: data.factors }); if ($page.url.searchParams) { const redirect = $page.url.searchParams.get('redirect'); $page.url.searchParams.delete('redirect'); diff --git a/src/routes/(public)/(guest)/login/+page.svelte b/src/routes/(public)/(guest)/login/+page.svelte index 2bde63340..403e6038a 100644 --- a/src/routes/(public)/(guest)/login/+page.svelte +++ b/src/routes/(public)/(guest)/login/+page.svelte @@ -23,7 +23,7 @@ await sdk.forConsole.account.createEmailPasswordSession(mail, pass); await invalidate(Dependencies.ACCOUNT); if ($user) { - trackEvent(Submit.AccountLogin); + trackEvent(Submit.AccountLogin, { mfa_used: 'none' }); addNotification({ type: 'success', message: 'Successfully logged in.' From b0483816595330d60f9d9ff49d691fc7eda2f683 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 13:10:57 +0100 Subject: [PATCH 04/34] Add mfa tracking --- src/lib/components/mfaChallengeFormList.svelte | 4 ++-- src/routes/(authenticated)/mfa/+page.svelte | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/components/mfaChallengeFormList.svelte b/src/lib/components/mfaChallengeFormList.svelte index 65b55acea..afc8b9c64 100644 --- a/src/lib/components/mfaChallengeFormList.svelte +++ b/src/lib/components/mfaChallengeFormList.svelte @@ -10,10 +10,10 @@ } await sdk.forConsole.account.updateMfaChallenge(challenge.$id, code); await invalidate(Dependencies.ACCOUNT); - trackEvent(Submit.AccountCreate); + trackEvent(Submit.AccountLogin, { mfa_used: true }); } catch (error) { inputDigitFields?.clearInputsAndRefocus(); - trackError(error, Submit.AccountCreate); + trackError(error, Submit.AccountLogin, { mfa_used: true }); throw error; } } diff --git a/src/routes/(authenticated)/mfa/+page.svelte b/src/routes/(authenticated)/mfa/+page.svelte index c3d12e33d..6a7974455 100644 --- a/src/routes/(authenticated)/mfa/+page.svelte +++ b/src/routes/(authenticated)/mfa/+page.svelte @@ -29,7 +29,6 @@ disabled = true; try { await verify(challenge, code); - trackEvent(Submit.AccountLogin, { mfa_used: data.factors }); if ($page.url.searchParams) { const redirect = $page.url.searchParams.get('redirect'); $page.url.searchParams.delete('redirect'); From b34067f6ba9fd0542a14e9844731db504ea705d4 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 13:12:51 +0100 Subject: [PATCH 05/34] Add mfa tracking --- src/lib/components/mfaChallengeFormList.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/mfaChallengeFormList.svelte b/src/lib/components/mfaChallengeFormList.svelte index afc8b9c64..4b69eef35 100644 --- a/src/lib/components/mfaChallengeFormList.svelte +++ b/src/lib/components/mfaChallengeFormList.svelte @@ -13,7 +13,7 @@ trackEvent(Submit.AccountLogin, { mfa_used: true }); } catch (error) { inputDigitFields?.clearInputsAndRefocus(); - trackError(error, Submit.AccountLogin, { mfa_used: true }); + trackError(error, Submit.AccountLogin); throw error; } } From 0b550f0ee4b8bf11ec30e4e73913a22a49d710c0 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 13:14:04 +0100 Subject: [PATCH 06/34] Only fire once on account create --- src/routes/(public)/(guest)/register/+page.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/(public)/(guest)/register/+page.svelte b/src/routes/(public)/(guest)/register/+page.svelte index 531170cb3..8763ba8a2 100644 --- a/src/routes/(public)/(guest)/register/+page.svelte +++ b/src/routes/(public)/(guest)/register/+page.svelte @@ -61,7 +61,6 @@ } else { await goto(base); } - trackEvent(Submit.AccountCreate); } catch (error) { disabled = false; addNotification({ From 66cc2df308089ea21e717001c69312561362fda2 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 13:28:49 +0100 Subject: [PATCH 07/34] Fix billing address event --- src/routes/(console)/account/payments/editAddressModal.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/account/payments/editAddressModal.svelte b/src/routes/(console)/account/payments/editAddressModal.svelte index a70f9d8e7..74938b4af 100644 --- a/src/routes/(console)/account/payments/editAddressModal.svelte +++ b/src/routes/(console)/account/payments/editAddressModal.svelte @@ -51,10 +51,10 @@ type: 'success', message: `Address has been added` }); - trackEvent(Submit.BillingAddressCreate); + trackEvent(Submit.BillingAddressUpdate); } catch (e) { error = e.message; - trackError(e, Submit.BillingAddressCreate); + trackError(e, Submit.BillingAddressUpdate); } } From 63ea62f0cb90c0ba0bb482c99cb0bbb405e28ff2 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 13:50:34 +0100 Subject: [PATCH 08/34] Track clear search --- src/lib/actions/analytics.ts | 3 ++- src/lib/commandCenter/panels/template.svelte | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 19975c6ee..4ecac8b32 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -344,5 +344,6 @@ export enum Submit { SiteActivateDeployment = 'submit_site_activate_deployment', RecordCreate = 'submit_dns_record_create', RecordUpdate = 'submit_dns_record_update', - RecordDelete = 'submit_dns_record_delete' + RecordDelete = 'submit_dns_record_delete', + SearchClear = 'submit_clear_search' } diff --git a/src/lib/commandCenter/panels/template.svelte b/src/lib/commandCenter/panels/template.svelte index d23c1f405..83071bcaf 100644 --- a/src/lib/commandCenter/panels/template.svelte +++ b/src/lib/commandCenter/panels/template.svelte @@ -10,6 +10,7 @@ import { clearSubPanels, popSubPanel, subPanels } from '../subPanels'; import { IconArrowSmRight } from '@appwrite.io/pink-icons-svelte'; import { Icon, Keyboard, Layout } from '@appwrite.io/pink-svelte'; + import { Submit, trackEvent } from '$lib/actions/analytics'; /* eslint no-undef: "off" */ type Option = $$Generic & { group?: string }>; @@ -22,6 +23,7 @@ let selected = 0; let usingKeyboard = false; let contentEl: HTMLElement; + let didSearch = false; async function triggerOption(option: Option) { const prevPanels = $subPanels.length; @@ -43,6 +45,14 @@ if (!open) return; usingKeyboard = true; + if (search.length > 0) { + didSearch = true; + } + + if (search === '' && didSearch) { + trackEvent(Submit.SearchClear); + } + let canceled = false; dispatch('keydown', { originalEvent: event, From 834a34a2f833de6da30ed05cea7943c36749ee27 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 14:00:37 +0100 Subject: [PATCH 09/34] Track create org in breadcrumbs --- src/lib/actions/analytics.ts | 1 + src/lib/components/breadcrumbs.svelte | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 4ecac8b32..98d95c721 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -297,6 +297,7 @@ export enum Submit { OrganizationUpgrade = 'submit_organization_upgrade', OrganizationDowngrade = 'submit_organization_downgrade', OrganizationBillingTaxIdUpdate = 'submit_organization_billing_tax_id_update', + OrganizationClickCreate = 'click_create_organization', SupportTicket = 'submit_support_ticket', InstallationCreate = 'submit_installation_create', InstallationDelete = 'submit_installation_delete', diff --git a/src/lib/components/breadcrumbs.svelte b/src/lib/components/breadcrumbs.svelte index a0cb4468e..8b13fc719 100644 --- a/src/lib/components/breadcrumbs.svelte +++ b/src/lib/components/breadcrumbs.svelte @@ -13,6 +13,7 @@ import { goto } from '$app/navigation'; import { base } from '$app/paths'; import { newOrgModal } from '$lib/stores/organization'; + import { Submit, trackEvent } from '$lib/actions/analytics'; type Project = { name: string; @@ -68,6 +69,7 @@ let projectsBottomSheetOpen = false; function createOrg() { + trackEvent(Submit.OrganizationClickCreate, { source: 'breadcrumbs' }); if (isCloud) { goto(`${base}/create-organization`); } else newOrgModal.set(true); From fee2bafc97247d663d6e452b4fe5ce4895e9a11c Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 14:06:14 +0100 Subject: [PATCH 10/34] Add platfrom create click --- src/lib/actions/analytics.ts | 1 + src/routes/(console)/project-[project]/overview/onboard.svelte | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 98d95c721..ffd0c2159 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -252,6 +252,7 @@ export enum Submit { PlatformCreate = 'submit_platform_create', PlatformDelete = 'submit_platform_delete', PlatformUpdate = 'submit_platform_update', + PlatformCreateClick = 'click_platform_create', DomainCreate = 'submit_domain_create', DomainDelete = 'submit_domain_delete', DomainUpdateVerification = 'submit_domain_update_verification', diff --git a/src/routes/(console)/project-[project]/overview/onboard.svelte b/src/routes/(console)/project-[project]/overview/onboard.svelte index 106aad1a6..427bdbe55 100644 --- a/src/routes/(console)/project-[project]/overview/onboard.svelte +++ b/src/routes/(console)/project-[project]/overview/onboard.svelte @@ -35,7 +35,7 @@ import { AvatarGroup } from '$lib/components'; import type { Models } from '@appwrite.io/console'; import { getPlatformInfo } from '$lib/helpers/platform'; - import { trackEvent } from '$lib/actions/analytics'; + import { Submit, trackEvent } from '$lib/actions/analytics'; import { goto } from '$app/navigation'; function createKey() { @@ -56,6 +56,7 @@ if (platform) { continuePlatform(type, platform.name, platform.key, platform.type); } else { + trackEvent(Submit.PlatformCreateClick, { source: 'onboard_hub' }); addPlatform(type); } } From 610ebfa3ad8a0f423384d58249ed1a3ec7b17ad7 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 14:06:26 +0100 Subject: [PATCH 11/34] Add platfrom create click --- src/routes/(console)/project-[project]/overview/onboard.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[project]/overview/onboard.svelte b/src/routes/(console)/project-[project]/overview/onboard.svelte index 427bdbe55..79eeebbf5 100644 --- a/src/routes/(console)/project-[project]/overview/onboard.svelte +++ b/src/routes/(console)/project-[project]/overview/onboard.svelte @@ -56,7 +56,7 @@ if (platform) { continuePlatform(type, platform.name, platform.key, platform.type); } else { - trackEvent(Submit.PlatformCreateClick, { source: 'onboard_hub' }); + trackEvent(Submit.PlatformCreateClick, { source: 'onboarding' }); addPlatform(type); } } From 7d616c8da34d5b89522ac757a5a1a3bf4dc2817e Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 14:20:31 +0100 Subject: [PATCH 12/34] Fix onboarding events --- src/lib/actions/analytics.ts | 12 ++++++++- .../project-[project]/overview/onboard.svelte | 25 ++++++++++--------- .../overview/platforms/+page.svelte | 8 +++--- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index ffd0c2159..82fe894a7 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -249,6 +249,7 @@ export enum Submit { KeyUpdateName = 'submit_key_update_name', KeyUpdateScopes = 'submit_key_update_scopes', KeyUpdateExpire = 'submit_key_update_expire', + KeyCreateClick = 'click_key_create', PlatformCreate = 'submit_platform_create', PlatformDelete = 'submit_platform_delete', PlatformUpdate = 'submit_platform_update', @@ -347,5 +348,14 @@ export enum Submit { RecordCreate = 'submit_dns_record_create', RecordUpdate = 'submit_dns_record_update', RecordDelete = 'submit_dns_record_delete', - SearchClear = 'submit_clear_search' + SearchClear = 'submit_clear_search', + OnboardingSetupDatabaseClick = 'click_onboarding_setup_database', + OnboardingApiReferencesClick = 'click_onboarding_api_references', + OnboardingTutorialsClick = 'click_onboarding_tutorials', + OnboardingStorageQuickstartClick = 'click_onboarding_storage_quickstart', + OnboardingFunctionsQuickstartClick = 'click_onboarding_functions_quickstart', + OnboardingAuthEmailPasswordClick = 'click_onboarding_auth_email_password', + OnboardingAuthOauth2Click = 'click_onboarding_auth_oauth2', + OnboardingAuthAllMethodsClick = 'click_onboarding_auth_all_methods', + OnboardingDiscordClick = 'click_onboarding_discord' } diff --git a/src/routes/(console)/project-[project]/overview/onboard.svelte b/src/routes/(console)/project-[project]/overview/onboard.svelte index 79eeebbf5..84e7e3b43 100644 --- a/src/routes/(console)/project-[project]/overview/onboard.svelte +++ b/src/routes/(console)/project-[project]/overview/onboard.svelte @@ -39,9 +39,8 @@ import { goto } from '$app/navigation'; function createKey() { - trackEvent('onboarding_hub_platform', { - platform: 'server', - state: 'add' + trackEvent(Submit.KeyCreateClick, { + source: 'onboarding' }); goto(`${base}/project-${projectId}/overview/keys/create`, { replaceState: true @@ -393,7 +392,7 @@ direction={$isSmallViewport ? 'column' : 'row'}> { - trackEvent('onboarding_hub_setup_databases'); + trackEvent(Submit.OnboardingSetupDatabaseClick); goto(`${base}/project-${projectId}/databases`); }} padding="s" @@ -431,7 +430,7 @@ href="https://appwrite.io/docs/references" on:click={() => { trackEvent( - 'onboarding_hub_api_references' + Submit.OnboardingApiReferencesClick ); }} target="_blank">API references @@ -439,7 +438,9 @@ variant="quiet-muted" href="https://appwrite.io/docs/tutorials" on:click={() => { - trackEvent('onboarding_hub_tutorials'); + trackEvent( + Submit.OnboardingTutorialsClick + ); }} target="_blank">Tutorials { trackEvent( - 'onboarding_hub_storage_quick_start' + Submit.OnboardingStorageQuickstartClick ); }} target="_blank" @@ -458,7 +459,7 @@ href="https://appwrite.io/docs/products/functions/quick-start" on:click={() => { trackEvent( - 'onboarding_hub_functions_quick_start' + Submit.OnboardingFunctionsQuickstartClick ); }} target="_blank" @@ -488,7 +489,7 @@ href={`${base}/project-${projectId}/auth/settings`} on:click={() => { trackEvent( - 'onboarding_hub_auth_email_password' + Submit.OnboardingAuthEmailPasswordClick ); }} >E-mail and password @@ -498,7 +499,7 @@ href={`${base}/project-${projectId}/auth/settings`} on:click={() => { trackEvent( - 'onboarding_hub_auth_oauth2' + Submit.OnboardingAuthOauth2Click ); }}>OAuth 2 { trackEvent( - 'onboarding_hub_auth_all_methods' + Submit.OnboardingAuthAllMethodsClick ); }}>View all methods @@ -526,7 +527,7 @@ href="https://appwrite.io/discord" padding="s" on:click={() => { - trackEvent('onboarding_hub_discord'); + trackEvent(Submit.OnboardingDiscordClick); }}>
diff --git a/src/routes/(console)/project-[project]/overview/platforms/+page.svelte b/src/routes/(console)/project-[project]/overview/platforms/+page.svelte index 0842bffc4..bdc5456c4 100644 --- a/src/routes/(console)/project-[project]/overview/platforms/+page.svelte +++ b/src/routes/(console)/project-[project]/overview/platforms/+page.svelte @@ -6,7 +6,7 @@ import CreateReactNative from './createReactNative.svelte'; import CreateWeb from './createWeb.svelte'; import { createPlatform, versions } from './wizard/store'; - import { trackEvent } from '$lib/actions/analytics'; + import { Submit, trackEvent } from '$lib/actions/analytics'; export enum Platform { Web, @@ -19,9 +19,9 @@ export async function addPlatform(type: Platform) { await versions.load(); createPlatform.reset(); - trackEvent('onboarding_hub_platform', { + trackEvent(Submit.PlatformCreateClick, { platform: platforms[type], - state: 'add' + source: 'platforms_page' }); wizard.start(platforms[type]); } @@ -38,7 +38,7 @@ key: key, type: type }); - trackEvent('onboarding_hub_platform', { + trackEvent(Submit.PlatformCreateClick, { platform: platforms[platform], state: 'continue' }); From 6203e86090ef9e3b5f9689b9cf57ed9e3e6ecd0f Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 15:47:13 +0100 Subject: [PATCH 13/34] Introduce click enum --- src/lib/actions/analytics.ts | 32 +++++++++++-------- src/lib/components/breadcrumbs.svelte | 4 +-- .../project-[project]/overview/onboard.svelte | 24 +++++++------- .../overview/platforms/+page.svelte | 6 ++-- 4 files changed, 36 insertions(+), 30 deletions(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 82fe894a7..2a592b8af 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -138,6 +138,21 @@ export function isTrackingAllowed() { } } +export enum Click { + KeyCreateClick = 'click_key_create', + PlatformCreateClick = 'click_platform_create', + OrganizationClickCreate = 'click_create_organization', + OnboardingSetupDatabaseClick = 'click_onboarding_setup_database', + OnboardingApiReferencesClick = 'click_onboarding_api_references', + OnboardingTutorialsClick = 'click_onboarding_tutorials', + OnboardingStorageQuickstartClick = 'click_onboarding_storage_quickstart', + OnboardingFunctionsQuickstartClick = 'click_onboarding_functions_quickstart', + OnboardingAuthEmailPasswordClick = 'click_onboarding_auth_email_password', + OnboardingAuthOauth2Click = 'click_onboarding_auth_oauth2', + OnboardingAuthAllMethodsClick = 'click_onboarding_auth_all_methods', + OnboardingDiscordClick = 'click_onboarding_discord' +} + export enum Submit { DownloadDPA = 'submit_download_dpa', Error = 'submit_error', @@ -249,11 +264,11 @@ export enum Submit { KeyUpdateName = 'submit_key_update_name', KeyUpdateScopes = 'submit_key_update_scopes', KeyUpdateExpire = 'submit_key_update_expire', - KeyCreateClick = 'click_key_create', + PlatformCreate = 'submit_platform_create', PlatformDelete = 'submit_platform_delete', PlatformUpdate = 'submit_platform_update', - PlatformCreateClick = 'click_platform_create', + DomainCreate = 'submit_domain_create', DomainDelete = 'submit_domain_delete', DomainUpdateVerification = 'submit_domain_update_verification', @@ -299,7 +314,7 @@ export enum Submit { OrganizationUpgrade = 'submit_organization_upgrade', OrganizationDowngrade = 'submit_organization_downgrade', OrganizationBillingTaxIdUpdate = 'submit_organization_billing_tax_id_update', - OrganizationClickCreate = 'click_create_organization', + SupportTicket = 'submit_support_ticket', InstallationCreate = 'submit_installation_create', InstallationDelete = 'submit_installation_delete', @@ -348,14 +363,5 @@ export enum Submit { RecordCreate = 'submit_dns_record_create', RecordUpdate = 'submit_dns_record_update', RecordDelete = 'submit_dns_record_delete', - SearchClear = 'submit_clear_search', - OnboardingSetupDatabaseClick = 'click_onboarding_setup_database', - OnboardingApiReferencesClick = 'click_onboarding_api_references', - OnboardingTutorialsClick = 'click_onboarding_tutorials', - OnboardingStorageQuickstartClick = 'click_onboarding_storage_quickstart', - OnboardingFunctionsQuickstartClick = 'click_onboarding_functions_quickstart', - OnboardingAuthEmailPasswordClick = 'click_onboarding_auth_email_password', - OnboardingAuthOauth2Click = 'click_onboarding_auth_oauth2', - OnboardingAuthAllMethodsClick = 'click_onboarding_auth_all_methods', - OnboardingDiscordClick = 'click_onboarding_discord' + SearchClear = 'submit_clear_search' } diff --git a/src/lib/components/breadcrumbs.svelte b/src/lib/components/breadcrumbs.svelte index 8b13fc719..22ea46606 100644 --- a/src/lib/components/breadcrumbs.svelte +++ b/src/lib/components/breadcrumbs.svelte @@ -13,7 +13,7 @@ import { goto } from '$app/navigation'; import { base } from '$app/paths'; import { newOrgModal } from '$lib/stores/organization'; - import { Submit, trackEvent } from '$lib/actions/analytics'; + import { Click, trackEvent } from '$lib/actions/analytics'; type Project = { name: string; @@ -69,7 +69,7 @@ let projectsBottomSheetOpen = false; function createOrg() { - trackEvent(Submit.OrganizationClickCreate, { source: 'breadcrumbs' }); + trackEvent(Click.OrganizationClickCreate, { source: 'breadcrumbs' }); if (isCloud) { goto(`${base}/create-organization`); } else newOrgModal.set(true); diff --git a/src/routes/(console)/project-[project]/overview/onboard.svelte b/src/routes/(console)/project-[project]/overview/onboard.svelte index 84e7e3b43..129978a3f 100644 --- a/src/routes/(console)/project-[project]/overview/onboard.svelte +++ b/src/routes/(console)/project-[project]/overview/onboard.svelte @@ -35,11 +35,11 @@ import { AvatarGroup } from '$lib/components'; import type { Models } from '@appwrite.io/console'; import { getPlatformInfo } from '$lib/helpers/platform'; - import { Submit, trackEvent } from '$lib/actions/analytics'; + import { Click, trackEvent } from '$lib/actions/analytics'; import { goto } from '$app/navigation'; function createKey() { - trackEvent(Submit.KeyCreateClick, { + trackEvent(Click.KeyCreateClick, { source: 'onboarding' }); goto(`${base}/project-${projectId}/overview/keys/create`, { @@ -55,7 +55,7 @@ if (platform) { continuePlatform(type, platform.name, platform.key, platform.type); } else { - trackEvent(Submit.PlatformCreateClick, { source: 'onboarding' }); + trackEvent(Click.PlatformCreateClick, { source: 'onboarding' }); addPlatform(type); } } @@ -392,7 +392,7 @@ direction={$isSmallViewport ? 'column' : 'row'}> { - trackEvent(Submit.OnboardingSetupDatabaseClick); + trackEvent(Click.OnboardingSetupDatabaseClick); goto(`${base}/project-${projectId}/databases`); }} padding="s" @@ -430,7 +430,7 @@ href="https://appwrite.io/docs/references" on:click={() => { trackEvent( - Submit.OnboardingApiReferencesClick + Click.OnboardingApiReferencesClick ); }} target="_blank">API references @@ -439,7 +439,7 @@ href="https://appwrite.io/docs/tutorials" on:click={() => { trackEvent( - Submit.OnboardingTutorialsClick + Click.OnboardingTutorialsClick ); }} target="_blank">Tutorials @@ -448,7 +448,7 @@ href="https://appwrite.io/docs/products/storage/quick-start" on:click={() => { trackEvent( - Submit.OnboardingStorageQuickstartClick + Click.OnboardingStorageQuickstartClick ); }} target="_blank" @@ -459,7 +459,7 @@ href="https://appwrite.io/docs/products/functions/quick-start" on:click={() => { trackEvent( - Submit.OnboardingFunctionsQuickstartClick + Click.OnboardingFunctionsQuickstartClick ); }} target="_blank" @@ -489,7 +489,7 @@ href={`${base}/project-${projectId}/auth/settings`} on:click={() => { trackEvent( - Submit.OnboardingAuthEmailPasswordClick + Click.OnboardingAuthEmailPasswordClick ); }} >E-mail and password @@ -499,7 +499,7 @@ href={`${base}/project-${projectId}/auth/settings`} on:click={() => { trackEvent( - Submit.OnboardingAuthOauth2Click + Click.OnboardingAuthOauth2Click ); }}>OAuth 2 { trackEvent( - Submit.OnboardingAuthAllMethodsClick + Click.OnboardingAuthAllMethodsClick ); }}>View all methods @@ -527,7 +527,7 @@ href="https://appwrite.io/discord" padding="s" on:click={() => { - trackEvent(Submit.OnboardingDiscordClick); + trackEvent(Click.OnboardingDiscordClick); }}>
diff --git a/src/routes/(console)/project-[project]/overview/platforms/+page.svelte b/src/routes/(console)/project-[project]/overview/platforms/+page.svelte index bdc5456c4..0975c0733 100644 --- a/src/routes/(console)/project-[project]/overview/platforms/+page.svelte +++ b/src/routes/(console)/project-[project]/overview/platforms/+page.svelte @@ -6,7 +6,7 @@ import CreateReactNative from './createReactNative.svelte'; import CreateWeb from './createWeb.svelte'; import { createPlatform, versions } from './wizard/store'; - import { Submit, trackEvent } from '$lib/actions/analytics'; + import { Click, trackEvent } from '$lib/actions/analytics'; export enum Platform { Web, @@ -19,7 +19,7 @@ export async function addPlatform(type: Platform) { await versions.load(); createPlatform.reset(); - trackEvent(Submit.PlatformCreateClick, { + trackEvent(Click.PlatformCreateClick, { platform: platforms[type], source: 'platforms_page' }); @@ -38,7 +38,7 @@ key: key, type: type }); - trackEvent(Submit.PlatformCreateClick, { + trackEvent(Click.PlatformCreateClick, { platform: platforms[platform], state: 'continue' }); From 017b1b93c854ff8a83fde360c59fa4c07b65d6d9 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 15:51:36 +0100 Subject: [PATCH 14/34] Update exiting clicks to enum --- src/lib/actions/analytics.ts | 4 ++++ src/lib/components/fakeModal.svelte | 8 ++++---- src/lib/components/modalSideCol.svelte | 4 ++-- src/lib/components/modalWrapper.svelte | 6 +++--- src/lib/layout/breadcrumbs.svelte | 4 ++-- src/lib/layout/header.svelte | 6 +++--- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 2a592b8af..a6050a508 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -139,9 +139,13 @@ export function isTrackingAllowed() { } export enum Click { + BreadcrumbClick = 'click_breadcrumb', KeyCreateClick = 'click_key_create', + MenuDropDownClick = 'click_menu_dropdown', + ModalCloseClick = 'click_close_modal', PlatformCreateClick = 'click_platform_create', OrganizationClickCreate = 'click_create_organization', + OrganizationClickUpgrade = 'click_organization_upgrade', OnboardingSetupDatabaseClick = 'click_onboarding_setup_database', OnboardingApiReferencesClick = 'click_onboarding_api_references', OnboardingTutorialsClick = 'click_onboarding_tutorials', diff --git a/src/lib/components/fakeModal.svelte b/src/lib/components/fakeModal.svelte index 23bb89aa7..23ff6c99e 100644 --- a/src/lib/components/fakeModal.svelte +++ b/src/lib/components/fakeModal.svelte @@ -2,7 +2,7 @@ import { Alert } from '$lib/components'; import { onMount } from 'svelte'; import Form from '$lib/elements/forms/form.svelte'; - import { trackEvent } from '$lib/actions/analytics'; + import { Click, trackEvent } from '$lib/actions/analytics'; import { clickOnEnter } from '$lib/helpers/a11y'; export let show = false; @@ -23,7 +23,7 @@ function handleBLur(event: MouseEvent) { if (event.target === backdrop) { - trackEvent('click_close_modal', { + trackEvent(Click.ModalCloseClick, { from: 'backdrop' }); closeModal(); @@ -38,7 +38,7 @@ function handleKeydown(event: KeyboardEvent) { if (event.key === 'Escape') { event.preventDefault(); - trackEvent('click_close_modal', { + trackEvent(Click.ModalCloseClick, { from: 'escape' }); closeModal(); @@ -100,7 +100,7 @@ aria-label="Close Modal" title="Close Modal" on:click={() => - trackEvent('click_close_modal', { + trackEvent(Click.ModalCloseClick, { from: 'button' })} on:click={closeModal}> diff --git a/src/lib/components/modalSideCol.svelte b/src/lib/components/modalSideCol.svelte index ef737433a..af61e0496 100644 --- a/src/lib/components/modalSideCol.svelte +++ b/src/lib/components/modalSideCol.svelte @@ -1,6 +1,6 @@ diff --git a/src/lib/layout/header.svelte b/src/lib/layout/header.svelte index deeb75a5d..07685c62f 100644 --- a/src/lib/layout/header.svelte +++ b/src/lib/layout/header.svelte @@ -6,7 +6,7 @@ import { user } from '$lib/stores/user'; import { organizationList, organization, newOrgModal } from '$lib/stores/organization'; import { page } from '$app/stores'; - import { trackEvent } from '$lib/actions/analytics'; + import { Click, trackEvent } from '$lib/actions/analytics'; import { tooltip } from '$lib/actions/tooltip'; import { toggleCommandCenter } from '$lib/commandCenter/commandCenter.svelte'; import Button from '$lib/elements/forms/button.svelte'; @@ -53,7 +53,7 @@ } $: if (showDropdown) { - trackEvent('click_menu_dropdown'); + trackEvent(Click.MenuDropDownClick); } const slideFade: typeof slide = (node, options) => { @@ -97,7 +97,7 @@ disabled={$organization?.markedForDeletion} href={$upgradeURL} on:click={() => { - trackEvent('click_organization_upgrade', { + trackEvent(Click.OrganizationClickUpgrade, { from: 'button', source: 'top_nav' }); From fb1a2235466153868c20ce2d4773db8bd68a6fc4 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 16:03:50 +0100 Subject: [PATCH 15/34] Auth events --- src/lib/actions/analytics.ts | 2 ++ .../auth/teams/team-[team]/updatePrefs.svelte | 4 ++-- .../auth/user-[user]/updateMfa.svelte | 4 ++-- .../project-[project]/settings/smtp/+page.svelte | 11 +++++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index a6050a508..e5258b55d 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -184,6 +184,7 @@ export enum Submit { UserUpdateName = 'submit_user_update_name', UserUpdatePassword = 'submit_user_update_password', UserUpdatePhone = 'submit_user_update_phone', + UserUpdateMfa = 'submit_user_update_mfa', UserUpdatePreferences = 'submit_user_update_preferences', UserUpdateStatus = 'submit_user_update_status', UserUpdateVerificationEmail = 'submit_user_update_verification_email', @@ -208,6 +209,7 @@ export enum Submit { ProviderUpdate = 'submit_provider_update', TeamCreate = 'submit_team_create', TeamDelete = 'submit_team_delete', + TeamUpdatePreferences = 'submit_team_update_preferences', TeamUpdateName = 'submit_team_update_name', AuthLimitUpdate = 'submit_auth_limit_update', AuthStatusUpdate = 'submit_auth_status_update', diff --git a/src/routes/(console)/project-[project]/auth/teams/team-[team]/updatePrefs.svelte b/src/routes/(console)/project-[project]/auth/teams/team-[team]/updatePrefs.svelte index 4ee943cdf..57ad95ab6 100644 --- a/src/routes/(console)/project-[project]/auth/teams/team-[team]/updatePrefs.svelte +++ b/src/routes/(console)/project-[project]/auth/teams/team-[team]/updatePrefs.svelte @@ -45,13 +45,13 @@ message: 'Preferences have been updated', type: 'success' }); - trackEvent(Submit.UserUpdatePreferences); + trackEvent(Submit.TeamUpdatePreferences); } catch (error) { addNotification({ message: error.message, type: 'error' }); - trackError(error, Submit.UserUpdatePreferences); + trackError(error, Submit.TeamUpdatePreferences); } } diff --git a/src/routes/(console)/project-[project]/auth/user-[user]/updateMfa.svelte b/src/routes/(console)/project-[project]/auth/user-[user]/updateMfa.svelte index 4251ed82e..14b0c4577 100644 --- a/src/routes/(console)/project-[project]/auth/user-[user]/updateMfa.svelte +++ b/src/routes/(console)/project-[project]/auth/user-[user]/updateMfa.svelte @@ -27,13 +27,13 @@ message: `Multi-factor authentication has been ${userMfa ? 'enabled' : 'disabled'}`, type: 'success' }); - trackEvent(Submit.UserUpdateEmail); + trackEvent(Submit.UserUpdateMfa); } catch (error) { addNotification({ message: error.message, type: 'error' }); - trackError(error, Submit.UserUpdateEmail); + trackError(error, Submit.UserUpdateMfa); } } diff --git a/src/routes/(console)/project-[project]/settings/smtp/+page.svelte b/src/routes/(console)/project-[project]/settings/smtp/+page.svelte index 1c970442c..a18459f50 100644 --- a/src/routes/(console)/project-[project]/settings/smtp/+page.svelte +++ b/src/routes/(console)/project-[project]/settings/smtp/+page.svelte @@ -8,7 +8,7 @@ import { invalidate } from '$app/navigation'; import { BillingPlan, Dependencies } from '$lib/constants'; import { addNotification } from '$lib/stores/notifications'; - import { Submit, trackError, trackEvent } from '$lib/actions/analytics'; + import { Click, Submit, trackError, trackEvent } from '$lib/actions/analytics'; import InputNumber from '$lib/elements/forms/inputNumber.svelte'; import { base } from '$app/paths'; import deepEqual from 'deep-equal'; @@ -127,7 +127,14 @@ status="info" title="Custom SMTP is a Pro plan feature. Upgrade to enable custom SMTP sever."> - + {:else} From e02fe1825892090b6de87618ee1c905069a4720e Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 16:22:07 +0100 Subject: [PATCH 16/34] Filter events --- src/lib/actions/analytics.ts | 3 +++ src/lib/components/filters/filters.svelte | 12 +++++++++++- .../collection-[collection]/+page.svelte | 7 ++++++- .../functions/function-[function]/+page.svelte | 14 ++++++++++++-- .../function-[function]/executions/+page.svelte | 10 ++++++++-- .../project-[project]/messaging/+page.svelte | 2 +- .../messaging/providers/+page.svelte | 2 +- .../messaging/topics/+page.svelte | 2 +- .../messaging/topics/topic-[topic]/+page.svelte | 4 ++-- 9 files changed, 45 insertions(+), 11 deletions(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index e5258b55d..332377855 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -140,6 +140,7 @@ export function isTrackingAllowed() { export enum Click { BreadcrumbClick = 'click_breadcrumb', + FilterApplyClick = 'click_apply_filter', KeyCreateClick = 'click_key_create', MenuDropDownClick = 'click_menu_dropdown', ModalCloseClick = 'click_close_modal', @@ -177,6 +178,8 @@ export enum Submit { AccountRecoveryCodesCreate = 'submit_account_recovery_codes_create', AccountRecoveryCodesUpdate = 'submit_account_recovery_codes_update', AccountDeleteIdentity = 'submit_account_delete_identity', + FilterClear = 'submit_clear_filter', + FilterApply = 'submit_filter_apply', UserCreate = 'submit_user_create', UserDelete = 'submit_user_delete', UserUpdateEmail = 'submit_user_update_email', diff --git a/src/lib/components/filters/filters.svelte b/src/lib/components/filters/filters.svelte index 509f283d3..6d9e7067f 100644 --- a/src/lib/components/filters/filters.svelte +++ b/src/lib/components/filters/filters.svelte @@ -16,6 +16,7 @@ import { createEventDispatcher } from 'svelte'; import { Icon, Layout, Popover } from '@appwrite.io/pink-svelte'; import { IconFilter, IconFilterLine } from '@appwrite.io/pink-icons-svelte'; + import { Click, Submit, trackEvent } from '$lib/actions/analytics'; export let query = '[]'; export let columns: Writable; @@ -25,6 +26,7 @@ export let clearOnClick = false; // When enabled the user doesn't have to click apply to clear the filters export let enableApply = false; export let quickFilters = false; + export let analyticsSource = ''; let displayQuickFilters = quickFilters; const dispatch = createEventDispatcher(); @@ -53,12 +55,14 @@ selectedColumn = null; queries.clearAll(); if (clearOnClick) { + trackEvent(Submit.FilterClear, { source: analyticsSource }); queries.apply(); } } function apply() { if (quickFilters && displayQuickFilters) { + trackEvent(Submit.FilterApply, { source: analyticsSource }); dispatch('apply'); } else if ( selectedColumn && @@ -118,7 +122,13 @@
- diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte b/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte index 4721a139f..984ed306c 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte @@ -243,7 +243,13 @@
- +
From a4a212a35fab97cbee69e00c421e444b1c10071e Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 5 Mar 2025 16:30:00 +0100 Subject: [PATCH 17/34] Database events --- src/lib/actions/analytics.ts | 4 ++++ .../collection-[collection]/attributes/+page.svelte | 2 ++ .../collection-[collection]/indexes/+page.svelte | 2 ++ .../collection-[collection]/settings/dangerZone.svelte | 8 +++++++- .../databases/database-[database]/settings/+page.svelte | 9 +++++++-- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 332377855..5aaa8915e 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -140,6 +140,10 @@ export function isTrackingAllowed() { export enum Click { BreadcrumbClick = 'click_breadcrumb', + DatabaseAttributeDelete = 'click_attribute_delete', + DatabaseIndexDelete = 'click_index_delete', + DatabaseColletionDelete = 'click_collection_delete', + DatabaseDatabaseDelete = 'click_database_delete', FilterApplyClick = 'click_apply_filter', KeyCreateClick = 'click_key_create', MenuDropDownClick = 'click_menu_dropdown', diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte index 7006db6bb..5840c4a72 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/+page.svelte @@ -35,6 +35,7 @@ IconTrash } from '@appwrite.io/pink-icons-svelte'; import type { ComponentProps } from 'svelte'; + import { Click, trackEvent } from '$lib/actions/analytics'; const projectId = $page.params.project; const databaseId = $page.params.database; @@ -179,6 +180,7 @@ selectedAttribute = attribute; showDelete = true; showDropdown[index] = false; + trackEvent(Click.DatabaseAttributeDelete); }}> Delete diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte index 7209794d8..5718a8c3f 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte @@ -31,6 +31,7 @@ IconTrash } from '@appwrite.io/pink-icons-svelte'; import type { ComponentProps } from 'svelte'; + import { Click, trackEvent } from '$lib/actions/analytics'; let showDropdown = []; let selectedIndex: Models.Index = null; @@ -128,6 +129,7 @@ on:click={() => { selectedIndex = index; showDelete = true; + trackEvent(Click.DatabaseIndexDelete); }}>Delete diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/settings/dangerZone.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/settings/dangerZone.svelte index eb64d0fff..1b7dcfbd9 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/settings/dangerZone.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/settings/dangerZone.svelte @@ -4,6 +4,7 @@ import { toLocaleDateTime } from '$lib/helpers/date'; import { collection } from '../store'; import Delete from './deleteCollection.svelte'; + import { Click, trackEvent } from '$lib/actions/analytics'; let showDelete = false; @@ -22,7 +23,12 @@ - + diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/settings/+page.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/settings/+page.svelte index 6cecdb91a..bab02f56a 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/settings/+page.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/settings/+page.svelte @@ -1,7 +1,7 @@ @@ -8,6 +9,11 @@

Upgrade your plan to add more {service}

- +
diff --git a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/+page.svelte b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/+page.svelte index 6c6733d8d..d3767a49b 100644 --- a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/+page.svelte +++ b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/+page.svelte @@ -87,6 +87,7 @@ import { GRACE_PERIOD_OVERRIDE } from '$lib/system'; import { isValueOfStringEnum } from '$lib/helpers/types'; import type { PageData } from './$types'; + import { Click } from '$lib/actions/analytics'; export let data: PageData; @@ -442,7 +443,12 @@ - + {/if} diff --git a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte index c5b32d225..63bce10e7 100644 --- a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte +++ b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte @@ -1,5 +1,5 @@ @@ -20,7 +21,12 @@ - + diff --git a/src/routes/(console)/project-[project]/settings/webhooks/[webhook]/updateSignature.svelte b/src/routes/(console)/project-[project]/settings/webhooks/[webhook]/updateSignature.svelte index ddbd8da2a..1632e7dbc 100644 --- a/src/routes/(console)/project-[project]/settings/webhooks/[webhook]/updateSignature.svelte +++ b/src/routes/(console)/project-[project]/settings/webhooks/[webhook]/updateSignature.svelte @@ -4,6 +4,7 @@ import { Link } from '@appwrite.io/pink-svelte'; import Regenerate from './regenerate.svelte'; import { webhook } from './store'; + import { Click, trackEvent } from '$lib/actions/analytics'; let showRegenerate = false; @@ -22,7 +23,13 @@
- + From ca85fcc253ee7b6ba94596cd6b5dd78bbbdab49d Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 6 Mar 2025 14:56:08 +0100 Subject: [PATCH 30/34] feedback --- src/lib/actions/analytics.ts | 2 ++ src/lib/components/navbar.svelte | 3 ++- src/lib/components/sidebar.svelte | 3 ++- src/lib/layout/header.svelte | 1 + src/lib/stores/feedback.ts | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 1f74c2eca..862554d2f 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -147,6 +147,7 @@ export enum Click { DomainCreateClick = 'click_domain_create', DomainDeleteClick = 'click_domain_delete', DomainRetryDomainVerificationClick = 'click_domain_retry_domain_verification', + FeedbackSubmitClick = 'click_leave_feedback', FilterApplyClick = 'click_apply_filter', FunctionsRedeployClick = 'click_function_redeploy', FunctionsDeploymentDeleteClick = 'click_deployment_delete', @@ -198,6 +199,7 @@ export enum Submit { AccountRecoveryCodesCreate = 'submit_account_recovery_codes_create', AccountRecoveryCodesUpdate = 'submit_account_recovery_codes_update', AccountDeleteIdentity = 'submit_account_delete_identity', + FeedbackSubmit = 'submit_leave_feedback', FilterClear = 'submit_clear_filter', FilterApply = 'submit_filter_apply', UserCreate = 'submit_user_create', diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelte index 3f7f5fe86..673d4a383 100644 --- a/src/lib/components/navbar.svelte +++ b/src/lib/components/navbar.svelte @@ -44,7 +44,7 @@ import { isTabletViewport } from '$lib/stores/viewport'; import { isCloud } from '$lib/system.js'; import { user } from '$lib/stores/user'; - import { trackEvent } from '$lib/actions/analytics'; + import { Click, trackEvent } from '$lib/actions/analytics'; let showSupport = false; @@ -80,6 +80,7 @@ } function toggleFeedback() { + trackEvent(Click.FeedbackSubmitClick); feedback.toggleFeedback(); if ($feedback.notification) { feedback.toggleNotification(); diff --git a/src/lib/components/sidebar.svelte b/src/lib/components/sidebar.svelte index bfebc14ca..86aefa2d3 100644 --- a/src/lib/components/sidebar.svelte +++ b/src/lib/components/sidebar.svelte @@ -34,7 +34,7 @@ import MobileFeedbackModal from '$routes/(console)/wizard/feedback/mobileFeedbackModal.svelte'; import { getSidebarState, updateSidebarState } from '$lib/helpers/sidebar'; import { isTabletViewport } from '$lib/stores/viewport'; - import { trackEvent } from '$lib/actions/analytics'; + import { Click, trackEvent } from '$lib/actions/analytics'; type $$Props = HTMLElement & { state?: 'closed' | 'open' | 'icons'; @@ -58,6 +58,7 @@ export let subNavigation = undefined; function toggleFeedback() { + trackEvent(Click.FeedbackSubmitClick); feedback.toggleFeedback(); if ($feedback.notification) { feedback.toggleNotification(); diff --git a/src/lib/layout/header.svelte b/src/lib/layout/header.svelte index 07685c62f..2c528951b 100644 --- a/src/lib/layout/header.svelte +++ b/src/lib/layout/header.svelte @@ -30,6 +30,7 @@ function toggleFeedback() { feedback.toggleFeedback(); + trackEvent(Click.FeedbackSubmitClick); if ($feedback.notification) { feedback.toggleNotification(); feedback.addVisualization(); diff --git a/src/lib/stores/feedback.ts b/src/lib/stores/feedback.ts index bd0af38d2..cac81def1 100644 --- a/src/lib/stores/feedback.ts +++ b/src/lib/stores/feedback.ts @@ -4,6 +4,7 @@ import { get, writable } from 'svelte/store'; import type { SvelteComponent } from 'svelte'; import FeedbackGeneral from '$lib/components/feedback/feedbackGeneral.svelte'; import FeedbackNps from '$lib/components/feedback/feedbackNPS.svelte'; +import { Submit, trackEvent } from '$lib/actions/analytics'; export type Feedback = { elapsed: number; @@ -118,6 +119,7 @@ function createFeedbackStore() { value?: number ) => { if (!VARS.GROWTH_ENDPOINT) return; + trackEvent(Submit.FeedbackSubmit); const response = await fetch(`${VARS.GROWTH_ENDPOINT}/feedback`, { method: 'POST', headers: { From 9c36abeab64ea8a7ab464edd97e9f5d9e4f60293 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 6 Mar 2025 14:58:00 +0100 Subject: [PATCH 31/34] support --- src/lib/actions/analytics.ts | 1 + src/lib/components/navbar.svelte | 2 +- src/lib/components/sidebar.svelte | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 862554d2f..c093f6978 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -174,6 +174,7 @@ export enum Click { SettingsWebhookDeleteClick = 'click_webhook_delete', SettingsInstallProviderClick = 'click_install_provider', SettingsStartMigrationClick = 'click_start_migration', + SupportOpenClick = 'click_open_support_menu', VariablesCreateClick = 'click_variable_create', VariablesUpdateClick = 'click_variable_update', VariablesImportClick = 'click_variable_import' diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelte index 673d4a383..d08eebd86 100644 --- a/src/lib/components/navbar.svelte +++ b/src/lib/components/navbar.svelte @@ -174,7 +174,7 @@ type="button" on:click={() => { showSupport = !showSupport; - trackEvent('click_menu_support', { source: 'top_nav' }); + trackEvent(Click.SupportOpenClick, { source: 'top_nav' }); }}> Support diff --git a/src/lib/components/sidebar.svelte b/src/lib/components/sidebar.svelte index 86aefa2d3..78f5681f3 100644 --- a/src/lib/components/sidebar.svelte +++ b/src/lib/components/sidebar.svelte @@ -259,7 +259,7 @@ size="s" on:click={() => { $showSupportModal = true; - trackEvent('click_menu_support', { source: 'side_nav' }); + trackEvent(Click.SupportOpenClick, { source: 'side_nav' }); }}> Support @@ -319,7 +319,7 @@ size="s" on:click={() => { $showSupportModal = true; - trackEvent('click_menu_support', { source: 'side_nav' }); + trackEvent(Click.SupportOpenClick, { source: 'side_nav' }); }}> Support From 438009dfc74592d157a3b34b346957cac0c4bf7c Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 6 Mar 2025 15:03:48 +0100 Subject: [PATCH 32/34] Legacy clicks replace --- src/lib/actions/analytics.ts | 1 + src/lib/components/billing/alerts/limitReached.svelte | 4 ++-- src/lib/components/billing/emptyCardCloud.svelte | 4 ++-- src/lib/components/bottomModalAlert.svelte | 6 +++--- src/lib/components/navbar.svelte | 2 +- src/lib/components/support.svelte | 6 +++--- src/lib/elements/table/body.svelte | 4 ++-- src/lib/stores/billing.ts | 4 ++-- .../billing/availableCredit.svelte | 4 ++-- .../organization-[organization]/billing/budgetAlert.svelte | 4 ++-- .../organization-[organization]/billing/budgetCap.svelte | 4 ++-- .../organization-[organization]/billing/planSummary.svelte | 4 ++-- .../usage/[[invoice]]/+page.svelte | 4 ++-- .../project-[project]/auth/templates/emailSignature.svelte | 4 ++-- 14 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index c093f6978..1408b84a8 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -175,6 +175,7 @@ export enum Click { SettingsInstallProviderClick = 'click_install_provider', SettingsStartMigrationClick = 'click_start_migration', SupportOpenClick = 'click_open_support_menu', + PromoClick = 'click_promo', VariablesCreateClick = 'click_variable_create', VariablesUpdateClick = 'click_variable_update', VariablesImportClick = 'click_variable_import' diff --git a/src/lib/components/billing/alerts/limitReached.svelte b/src/lib/components/billing/alerts/limitReached.svelte index f3b5cc4b9..bf150261e 100644 --- a/src/lib/components/billing/alerts/limitReached.svelte +++ b/src/lib/components/billing/alerts/limitReached.svelte @@ -1,7 +1,7 @@ diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/backups/restoreModal.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/backups/restoreModal.svelte index 706415d3d..10d7252fc 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/backups/restoreModal.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/backups/restoreModal.svelte @@ -1,6 +1,6 @@