diff --git a/site/src/components/Landing/Landing.tsx b/site/src/components/Landing/Landing.tsx index b721cf5c..12a1ec14 100644 --- a/site/src/components/Landing/Landing.tsx +++ b/site/src/components/Landing/Landing.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { clsx } from 'clsx'; import { Button, HStack, Icon, Image, Link, Text, VStack } from '@chakra-ui/react'; +import { useAnalyticsContext } from '../Analytics/useAnalyticsContext'; import Logo from './logo.svg'; import styles from './Landing.module.css'; @@ -9,6 +10,8 @@ import styles from './Landing.module.css'; export const Landing = ({ baseUrl }: { baseUrl: string }) => { const getUrl = (path: string) => [baseUrl, path].join('/').replace(/\/{2,}/g, '/'); + const { trackEvent } = useAnalyticsContext(); + return ( @@ -68,6 +71,11 @@ export const Landing = ({ baseUrl }: { baseUrl: string }) => { target="_blank" href="https://chrome.google.com/webstore/detail/gbefmodhlophhakmoecijeppjblibmie" px={4} + onClick={() => { + trackEvent('Download link: Click', { + target: 'chrome', + }); + }} > Install for Chrome @@ -84,6 +92,11 @@ export const Landing = ({ baseUrl }: { baseUrl: string }) => { target="_blank" href="https://addons.mozilla.org/addon/linguist-translator/" px={4} + onClick={() => { + trackEvent('Download link: Click', { + target: 'firefox', + }); + }} > Install for Firefox