Skip to content

Commit 42f0229

Browse files
add tracking events
1 parent f3d2e26 commit 42f0229

File tree

9 files changed

+44
-3
lines changed

9 files changed

+44
-3
lines changed

src/routes/(marketing)/(components)/bento/(animations)/auth.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { classNames } from '$lib/utils/classnames';
88
import GridPaper from '../../grid-paper.svelte';
99
import { unwrite, write } from '$lib/animations';
10+
import { trackEvent } from '$lib/actions/analytics';
1011
1112
let container: HTMLElement;
1213
@@ -45,6 +46,9 @@
4546
<a
4647
href="/products/auth"
4748
class="border-smooth col-span-12 flex flex-col rounded-2xl border bg-white/2 p-2 transition-shadow duration-300 hover:shadow-[0px_0px_0px_4px_var(--color-offset)] focus:shadow-[0px_0px_0px_4px_var(--color-offset)] md:col-span-6"
49+
onclick={() => {
50+
trackEvent(`bento-auth-click`);
51+
}}
4852
bind:this={container}
4953
>
5054
<div class="space-y-3 px-3 pt-2 pb-4">

src/routes/(marketing)/(components)/bento/(animations)/databases.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 { classNames } from '$lib/utils/classnames';
34
import { isMobile } from '$lib/utils/is-mobile';
45
import GridPaper from '../../grid-paper.svelte';
@@ -142,6 +143,9 @@
142143
<a
143144
href="/docs/products/databases"
144145
class="border-smooth col-span-12 flex flex-col rounded-2xl border bg-white/2 p-2 transition-shadow duration-300 hover:shadow-[0px_0px_0px_4px_var(--color-offset)] focus:shadow-[0px_0px_0px_4px_var(--color-offset)] md:col-span-6"
146+
onclick={() => {
147+
trackEvent(`bento-databases-click`);
148+
}}
145149
bind:this={container}
146150
>
147151
<div class="space-y-3 px-3 pt-2 pb-4">

src/routes/(marketing)/(components)/bento/(animations)/functions.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import { isMobile } from '$lib/utils/is-mobile';
66
import { classNames } from '$lib/utils/classnames';
77
import Checkmark from '$lib/components/fancy/checkmark.svelte';
8+
import { trackEvent } from '$lib/actions/analytics';
89
910
const commands = [
1011
'GenerateReport',
@@ -88,6 +89,9 @@
8889
<a
8990
href="/products/functions"
9091
class="border-smooth col-span-12 flex flex-col rounded-2xl border bg-white/2 p-2 transition-shadow duration-300 hover:shadow-[0px_0px_0px_4px_var(--color-offset)] focus:shadow-[0px_0px_0px_4px_var(--color-offset)] md:col-span-6 lg:col-span-4"
92+
onclick={() => {
93+
trackEvent(`bento-functions-click`);
94+
}}
9195
bind:this={container}
9296
>
9397
<div class="space-y-3 px-3 pt-2 pb-4">

src/routes/(marketing)/(components)/bento/(animations)/messaging.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import Messages from '../../../(assets)/icons/messages.svg';
99
import Settings from '../../../(assets)/icons/settings.svg';
1010
import GridPaper from '../../grid-paper.svelte';
11+
import { trackEvent } from '$lib/actions/analytics';
1112
1213
let container: HTMLElement;
1314
@@ -52,6 +53,9 @@
5253
<a
5354
href="/products/messaging"
5455
class="border-smooth group col-span-12 flex flex-col rounded-2xl border bg-white/2 p-2 transition-shadow duration-300 hover:shadow-[0px_0px_0px_4px_var(--color-offset)] focus:shadow-[0px_0px_0px_4px_var(--color-offset)] md:col-span-6 lg:col-span-4"
56+
onclick={() => {
57+
trackEvent(`bento-messaging-click`);
58+
}}
5559
bind:this={container}
5660
>
5761
<div class="space-y-3 px-3 pt-2 pb-4">

src/routes/(marketing)/(components)/bento/(animations)/realtime.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import TopRight from '../../../(assets)/images/top-right.svg';
77
import Puzzle from '../../../(assets)/images/puzzle.svg';
88
import GridPaper from '../../grid-paper.svelte';
9+
import { trackEvent } from '$lib/actions/analytics';
910
1011
let container: HTMLElement;
1112
@@ -60,6 +61,9 @@
6061
<a
6162
href="/docs/apis/realtime"
6263
class="border-smooth col-span-12 flex flex-col rounded-2xl border bg-white/2 p-2 transition-shadow duration-300 hover:shadow-[0px_0px_0px_4px_var(--color-offset)] focus:shadow-[0px_0px_0px_4px_var(--color-offset)] md:col-span-6 lg:col-span-5"
64+
onclick={() => {
65+
trackEvent(`bento-realtime-click`);
66+
}}
6367
bind:this={container}
6468
>
6569
<div class="space-y-3 px-3 pt-2 pb-4">

src/routes/(marketing)/(components)/bento/(animations)/sites.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { classNames } from '$lib/utils/classnames';
77
import Spinner from '../../spinner.svelte';
88
import { unwrite, write } from '$lib/animations';
9+
import { trackEvent } from '$lib/actions/analytics';
910
1011
let container: HTMLElement;
1112
let seconds = $state<number>(32);
@@ -100,6 +101,9 @@
100101
<a
101102
href="/products/sites"
102103
class="border-smooth group col-span-12 flex flex-col rounded-2xl border bg-white/2 p-2 transition-shadow duration-300 hover:shadow-[0px_0px_0px_4px_var(--color-offset)] focus:shadow-[0px_0px_0px_4px_var(--color-offset)] lg:col-span-7"
104+
onclick={() => {
105+
trackEvent(`bento-sites-click`);
106+
}}
103107
bind:this={container}
104108
>
105109
<div class="space-y-3 px-3 pt-2 pb-4">

src/routes/(marketing)/(components)/bento/(animations)/storage.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import { animate, hover, inView, type AnimationSequence } from 'motion';
55
import GridPaper from '../../grid-paper.svelte';
66
import { isMobile } from '$lib/utils/is-mobile';
7+
import { trackEvent } from '$lib/actions/analytics';
78
89
let container: HTMLElement;
910
let image: HTMLElement;
@@ -58,6 +59,9 @@
5859
<a
5960
href="/products/storage"
6061
class="border-smooth group col-span-12 flex flex-col rounded-2xl border bg-white/2 p-2 transition-shadow duration-300 hover:shadow-[0px_0px_0px_4px_var(--color-offset)] focus:shadow-[0px_0px_0px_4px_var(--color-offset)] md:col-span-6 lg:col-span-4"
62+
onclick={() => {
63+
trackEvent(`bento-storage-click`);
64+
}}
6165
bind:this={container}
6266
>
6367
<div class="space-y-3 px-3 pt-2 pb-4">

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
22
import { PUBLIC_APPWRITE_DASHBOARD } from '$env/static/public';
3+
import { trackEvent } from '$lib/actions/analytics';
34
import AppwriteIn100Seconds from '$lib/components/AppwriteIn100Seconds.svelte';
45
import GradientText from '$lib/components/fancy/gradient-text.svelte';
56
import { Button } from '$lib/components/ui';
@@ -40,8 +41,12 @@
4041
</p>
4142

4243
<div class="mt-4 flex flex-col gap-2 lg:flex-row">
43-
<Button href={PUBLIC_APPWRITE_DASHBOARD} class="w-full! lg:w-fit!"
44-
>Start building for free</Button
44+
<Button
45+
href={PUBLIC_APPWRITE_DASHBOARD}
46+
class="w-full! lg:w-fit!"
47+
onclick={() => {
48+
trackEvent(`hero-start-building-click`);
49+
}}>Start building for free</Button
4550
>
4651
<AppwriteIn100Seconds />
4752
</div>

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import GradientText from '$lib/components/fancy/gradient-text.svelte';
1919
import Noise from '$lib/components/fancy/noise.svelte';
2020
import { Tooltip } from 'bits-ui';
21+
import { trackEvent } from '$lib/actions/analytics';
2122
2223
const platforms = [
2324
{
@@ -119,7 +120,14 @@
119120
)}
120121
aria-hidden={i < platforms.length - 1}
121122
>
122-
<a href={platform.href} class="contents">
123+
<a
124+
href={platform.href}
125+
class="contents"
126+
onclick={() =>
127+
trackEvent(
128+
`technologies-${platform.name.replace(' ', '-').toLowerCase()}-click`
129+
)}
130+
>
123131
<img
124132
src={platform.icon}
125133
alt={platform.name}

0 commit comments

Comments
 (0)