Skip to content

Commit 1980227

Browse files
update events
1 parent 42f0229 commit 1980227

File tree

4 files changed

+36
-11
lines changed

4 files changed

+36
-11
lines changed

src/lib/components/appwrite-network/map-nav.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import type { IconType } from '../ui';
44
import Icon from '../ui/icon/icon.svelte';
55
import { classNames } from '$lib/utils/classnames';
6+
import { trackEvent } from '$lib/actions/analytics';
67
78
const {
89
onValueChange,
@@ -67,6 +68,9 @@
6768
'group data-[state="active"]:bg-accent/4 data-[state="active"]:border-accent/36 data-[state="active"]:text-accent'
6869
)}
6970
style="animation-delay:{index * 75}ms;"
71+
onclick={() => {
72+
trackEvent(`network-map-nav-${value}-click`);
73+
}}
7074
>
7175
<Icon
7276
name={icon}

src/routes/(marketing)/(components)/features.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import { trackEvent } from '$lib/actions/analytics';
23
import Icon from '$lib/components/ui/icon';
34
45
const features = [
@@ -73,6 +74,9 @@
7374
<a
7475
class="text-sub-body group relative border-b border-dashed border-black/8 px-4 py-8 font-medium last-of-type:border-0 nth-of-type-[4]:border-r-0 nth-of-type-[7]:border-b-0 max-lg:even:border-r-0 md:border-r lg:nth-of-type-[5]:border-b-0 lg:nth-of-type-[6]:border-b-0 lg:nth-of-type-[8]:border-b-0"
7576
href={box.href}
77+
onclick={() => {
78+
trackEvent(`feature-${box.label.toLowerCase().replace(' ', '-')}-click`);
79+
}}
7680
>
7781
<img loading="lazy" src={box.icon} width="40" height="40" alt="" />
7882
<h3 class="text-primary mt-4 flex flex-wrap items-center gap-0.5">

src/routes/(marketing)/(components)/hero.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
href={PUBLIC_APPWRITE_DASHBOARD}
4646
class="w-full! lg:w-fit!"
4747
onclick={() => {
48-
trackEvent(`hero-start-building-click`);
48+
trackEvent(`main-get_started_btn_hero-click`);
4949
}}>Start building for free</Button
5050
>
5151
<AppwriteIn100Seconds />

src/routes/(marketing)/(components)/pricing.svelte

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import { trackEvent } from '$lib/actions/analytics';
23
import Noise from '$lib/components/fancy/noise.svelte';
34
import { Button } from '$lib/components/ui';
45
import { classNames } from '$lib/utils/classnames';
@@ -10,30 +11,35 @@
1011
description: string;
1112
tag?: string;
1213
subtitle?: string;
14+
event: string;
1315
}> = [
1416
{
1517
name: 'Free',
1618
price: '$0',
17-
description: 'For personal hobby projects and students.'
19+
description: 'For personal hobby projects and students.',
20+
event: 'home-pricing-cards-free-click'
1821
},
1922
{
2023
name: 'Pro',
2124
price: '$15',
2225
tag: 'Popular',
2326
description: 'For pro developers and teams that need to scale their products.',
24-
subtitle: 'per member/month'
27+
subtitle: 'per member/month',
28+
event: 'home-pricing-cards-pro-click'
2529
},
2630
{
2731
name: 'Scale',
2832
price: '$599',
2933
description: 'For teams and products that need more control and support.',
30-
subtitle: 'per organization/month'
34+
subtitle: 'per organization/month',
35+
event: 'home-pricing-cards-scale-click'
3136
},
3237
{
3338
name: 'Enterprise',
3439
price: 'Custom',
3540
description: 'For enterprises that need more power and premium support.',
36-
subtitle: 'per organization/month'
41+
subtitle: 'per organization/month',
42+
event: 'home-pricing-cards-enterprise-click'
3743
}
3844
];
3945
</script>
@@ -58,19 +64,28 @@
5864
</h2>
5965

6066
<div class="mt-4 flex flex-col gap-2 lg:flex-row">
61-
<Button href={getAppwriteDashboardUrl()} class="w-full! md:w-fit!"
62-
>Start building for free</Button
67+
<Button
68+
href={getAppwriteDashboardUrl()}
69+
class="w-full! md:w-fit!"
70+
onclick={() => {
71+
trackEvent(`pricing-get-started-click`);
72+
}}>Start building for free</Button
6373
>
64-
<Button href="/pricing" class="w-full! md:w-fit!" variant="secondary"
65-
>View pricing plans</Button
74+
<Button
75+
onclick={() => {
76+
trackEvent(`pricing-view-plans-click`);
77+
}}
78+
href="/pricing"
79+
class="w-full! md:w-fit!"
80+
variant="secondary">View pricing plans</Button
6681
>
6782
</div>
6883
</div>
6984

7085
<div
7186
class="border-smooth divide-smooth grid min-h-75 w-full grid-cols-1 divide-y divide-dashed rounded-3xl border bg-white/2 backdrop-blur-lg md:grid-cols-2 md:gap-y-12 md:divide-y-0 md:px-4 md:py-8 lg:grid-cols-4 lg:divide-x"
7287
>
73-
{#each plans as { name, price, tag: label, subtitle, description }}
88+
{#each plans as { name, price, tag: label, subtitle, description, event }}
7489
{@const isEnterprise = name === 'Enterprise'}
7590
<div class="flex h-full w-full grow flex-col gap-1 px-5 py-5 md:pb-0">
7691
<div class="flex items-center gap-2.5">
@@ -96,7 +111,9 @@
96111
class="mt-8 mb-0 w-full!"
97112
variant={name === 'Pro' ? 'primary' : 'secondary'}
98113
href={isEnterprise ? '/contact-us/enterprise' : getAppwriteDashboardUrl()}
99-
>{isEnterprise ? 'Contact us' : 'Start building'}</Button
114+
onclick={() => {
115+
trackEvent(event);
116+
}}>{isEnterprise ? 'Contact us' : 'Start building'}</Button
100117
>
101118
</div>
102119
{/each}

0 commit comments

Comments
 (0)