Skip to content

Commit 257aec1

Browse files
authored
chore: track cloud/self-host click (#949)
1 parent 29adb85 commit 257aec1

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

src/components/shared/header/header.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Link from '@/components/shared/link';
88
import MobileMenu from '@/components/shared/mobile-menu';
99

1010
import Route from '@/lib/route';
11+
import { EVENTS } from '@/lib/events';
1112

1213
import AboutIcon from '@/svgs/about.inline.svg';
1314
import BlogIcon from '@/svgs/blog.inline.svg';
@@ -393,10 +394,22 @@ const Header = () => {
393394
</ul>
394395
<div className="ml-auto flex items-center gap-2 md:mr-10 sm:hidden">
395396
<GithubStarCounter />
396-
<Button href={Route.DOCS_CLOUD} theme="primary-outline" className="w-[88px]" size="sm">
397+
<Button
398+
href={Route.DOCS_CLOUD}
399+
theme="primary-outline"
400+
className="w-[88px]"
401+
size="sm"
402+
event={EVENTS.CLOUD_CLICK}
403+
>
397404
Cloud
398405
</Button>
399-
<Button href={Route.DOCS_SELF_HOST} theme="gray-filled" className="w-[116px]" size="sm">
406+
<Button
407+
href={Route.DOCS_SELF_HOST}
408+
theme="gray-filled"
409+
className="w-[116px]"
410+
size="sm"
411+
event={EVENTS.SELF_HOST_CLICK}
412+
>
400413
Self-host
401414
</Button>
402415
</div>

src/components/shared/mobile-menu/mobile-menu.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Button from '@/components/shared/button';
1313
import Link from '@/components/shared/link';
1414

1515
import Route from '@/lib/route';
16+
import { EVENTS } from '@/lib/events';
1617

1718
import AboutIcon from '@/svgs/about.inline.svg';
1819
import BlogIcon from '@/svgs/blog.inline.svg';
@@ -267,10 +268,20 @@ const MobileMenu = () => {
267268
</li>
268269
</div>
269270
<div className="sticky bottom-0 z-10 mt-auto hidden flex-col gap-4 pt-4 sm:flex sm:gap-2">
270-
<Button href={Route.DOCS_SELF_HOST} theme="gray-filled" size="md">
271+
<Button
272+
href={Route.DOCS_SELF_HOST}
273+
theme="gray-filled"
274+
size="md"
275+
event={EVENTS.SELF_HOST_CLICK}
276+
>
271277
Self-host
272278
</Button>
273-
<Button href={Route.DOCS_CLOUD} theme="primary-outline" size="md">
279+
<Button
280+
href={Route.DOCS_CLOUD}
281+
theme="primary-outline"
282+
size="md"
283+
event={EVENTS.CLOUD_CLICK}
284+
>
274285
Cloud
275286
</Button>
276287
</div>

src/lib/events.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export const EVENTS = {
22
PLAN_CLICK: 'plan.click',
3+
CLOUD_CLICK: 'cloud.click',
4+
SELF_HOST_CLICK: 'self-host.click',
35
};

0 commit comments

Comments
 (0)