diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelte index 0585199b5..2ff8986ec 100644 --- a/src/lib/components/navbar.svelte +++ b/src/lib/components/navbar.svelte @@ -44,6 +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'; let showSupport = false; @@ -68,6 +69,10 @@ : 'light' : theme; + trackEvent('select_theme', { + value: theme === 'auto' ? 'system' : theme + }); + app.update(() => ({ themeInUse: themeInUse, theme: theme @@ -130,12 +135,24 @@ { + trackEvent('click_organization_upgrade', { + from: 'button', + source: 'top_nav' + }); + }} href={`${base}/organization-${currentOrg.$id}/change-plan`} >Upgrade {/if} - toggleFeedback()} + { + toggleFeedback(); + trackEvent('click_menu_feedback', { source: 'top_nav' }); + }} >Feedback @@ -152,7 +169,10 @@ (showSupport = !showSupport)}> + on:click={() => { + showSupport = !showSupport; + trackEvent('click_menu_support', { source: 'top_nav' }); + }}> Support @@ -174,6 +194,9 @@ { showAccountMenu = !showAccountMenu; + if (showAccountMenu) { + trackEvent('click_menu_dropdown'); + } }}>
diff --git a/src/lib/components/sidebar.svelte b/src/lib/components/sidebar.svelte index aed4df6a1..b9462140a 100644 --- a/src/lib/components/sidebar.svelte +++ b/src/lib/components/sidebar.svelte @@ -34,6 +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'; type $$Props = HTMLElement & { state?: 'closed' | 'open' | 'icons'; @@ -112,6 +113,7 @@ class="progress-card" href={`/console/project-${project.$id}/get-started`} on:click={() => { + trackEvent('click_menu_get_started'); sideBarIsOpen = false; }}>
@@ -139,6 +141,7 @@ class="link" class:active={pathname.includes('overview')} on:click={() => { + trackEvent('click_menu_overview'); sideBarIsOpen = false; }} > { + trackEvent(`click_menu_${projectOption.slug}`); sideBarIsOpen = false; }} >
- { + trackEvent('click_menu_settings'); + }} + class="link" > toggleFeedback()} + on:click={() => { + toggleFeedback(); + trackEvent('click_menu_feedback', { source: 'side_nav' }); + }} >Feedback @@ -213,7 +225,10 @@ ($showSupportModal = true)}> + on:click={() => { + $showSupportModal = true; + trackEvent('click_menu_support', { source: 'side_nav' }); + }}> Support @@ -233,6 +248,9 @@ { + trackEvent('click_menu_settings'); + }} class:active={isOnProjectSettings} > toggleFeedback()} + on:click={() => { + toggleFeedback(); + trackEvent('click_menu_feedback', { source: 'side_nav' }); + }} >Feedback @@ -264,7 +285,10 @@ ($showSupportModal = true)}> + on:click={() => { + $showSupportModal = true; + trackEvent('click_menu_support', { source: 'side_nav' }); + }}> Support diff --git a/src/routes/(console)/onboarding/+page.svelte b/src/routes/(console)/onboarding/+page.svelte deleted file mode 100644 index e4c1f1ae7..000000000 --- a/src/routes/(console)/onboarding/+page.svelte +++ /dev/null @@ -1,149 +0,0 @@ - - - - - Create a new organization -
- - - {#if isCloud} -
-

Plan

-

- For more details on our plans, visit our . -

- - - -
- {/if} - -
-
-
-
diff --git a/src/routes/(console)/project-[project]/overview/header.svelte b/src/routes/(console)/project-[project]/overview/header.svelte index be16c1b39..d3251dceb 100644 --- a/src/routes/(console)/project-[project]/overview/header.svelte +++ b/src/routes/(console)/project-[project]/overview/header.svelte @@ -10,6 +10,7 @@ import { user } from '$lib/stores/user'; import { isSmallViewport } from '$lib/stores/viewport'; import { Dependencies } from '$lib/constants'; + import { trackEvent } from '$lib/actions/analytics'; {#if !$page.url.pathname.includes('get-started')} @@ -45,6 +46,7 @@ variant="secondary" size="s" on:click={async () => { + trackEvent('onboarding_hub_platform_dismiss'); await setHasOnboardingDismissed($project.$id); goto(`${base}/project-${$project.$id}/overview`); requestAnimationFrame(() => { diff --git a/src/routes/(console)/project-[project]/overview/onboard.svelte b/src/routes/(console)/project-[project]/overview/onboard.svelte index feeb49746..4c191ff50 100644 --- a/src/routes/(console)/project-[project]/overview/onboard.svelte +++ b/src/routes/(console)/project-[project]/overview/onboard.svelte @@ -37,8 +37,15 @@ 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 { redirect } from '@sveltejs/kit'; + import { goto } from '$app/navigation'; function createKey() { + trackEvent('onboarding_hub_platform', { + platform: 'server', + state: 'add' + }); wizard.start(Wizard); } @@ -386,7 +393,12 @@ - addPlatform(0)} padding="s" + { + trackEvent('onboarding_hub_setup_databases'); + goto(`${base}/project-${projectId}/databases`); + }} + padding="s" >
{ + trackEvent( + 'onboarding_hub_api_references' + ); + }} target="_blank">API references { + trackEvent('onboarding_hub_tutorials'); + }} target="_blank">Tutorials { + trackEvent( + 'onboarding_hub_storage_quick_start' + ); + }} target="_blank" >Storage quick start { + trackEvent( + 'onboarding_hub_functions_quick_start' + ); + }} target="_blank" >Functions quick start @@ -458,16 +488,29 @@ { + trackEvent( + 'onboarding_hub_auth_email_password' + ); + }} >E-mail and password OAuth 2 + on:click={() => { + trackEvent( + 'onboarding_hub_auth_oauth2' + ); + }}>OAuth 2 View all methods + on:click={() => { + trackEvent( + 'onboarding_hub_auth_all_methods' + ); + }}>View all methods
- + { + trackEvent('onboarding_hub_discord'); + }}>
diff --git a/src/routes/(console)/project-[project]/overview/platforms/+page.svelte b/src/routes/(console)/project-[project]/overview/platforms/+page.svelte index f6b27c860..83943e974 100644 --- a/src/routes/(console)/project-[project]/overview/platforms/+page.svelte +++ b/src/routes/(console)/project-[project]/overview/platforms/+page.svelte @@ -8,6 +8,7 @@ import CreateReactNative from './createReactNative.svelte'; import CreateWeb from './createWeb.svelte'; import { createPlatform, versions } from './wizard/store'; + import { trackEvent } from '$lib/actions/analytics'; export enum Platform { Web, @@ -20,6 +21,10 @@ export async function addPlatform(type: Platform) { await versions.load(); createPlatform.reset(); + trackEvent('onboarding_hub_platform', { + platform: platforms[type], + state: 'add' + }); wizard.start(platforms[type]); } @@ -35,6 +40,10 @@ key: key, type: type }); + trackEvent('onboarding_hub_platform', { + platform: platforms[platform], + state: 'continue' + }); wizard.start(platforms[platform], null, 1, { isPlatformCreated: true, platform: type,