Skip to content

Commit

Permalink
Tidy up analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
DinerIsmail committed Nov 27, 2023
1 parent d57d051 commit 1ee19c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/drawer/Drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import va from '@vercel/analytics'
import { track } from '@vercel/analytics'
import NextLink from 'next/link'
import { memo } from 'react'
import Select from 'react-select'
Expand Down Expand Up @@ -161,7 +161,7 @@ const Drawer = ({
className={styles.donateButton}
colorScheme="rw.700"
size="lg"
onClick={() => va.track('donate-click', { web: selectedWebName })}
onClick={() => track('donate-click', { web: selectedWebName })}
rightIcon={<HiHeart />}
>
Donate
Expand Down
3 changes: 3 additions & 0 deletions components/feedback-dialog/FeedbackDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
chakra,
useToast,
} from '@chakra-ui/react'
import { track } from '@vercel/analytics/react'

import {
emailRequiredValidator,
Expand All @@ -42,6 +43,8 @@ const FeedbackDialog = ({ isOpen, onClose }) => {
})
const result = await response.json()

track('feedback-submit')

if (!result.error) {
toast({
title: 'Success',
Expand Down
4 changes: 2 additions & 2 deletions components/nav/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Image from 'next/legacy/image'
import NextLink from 'next/link'
import { useSession } from 'next-auth/react'
import { useRouter } from 'next/router'
import va from '@vercel/analytics'
import { track } from '@vercel/analytics'
import {
Box,
Flex,
Expand Down Expand Up @@ -59,7 +59,7 @@ export default function MainNav() {
} = useDisclosure()

const handleOpenFeedbackDialog = useCallback(() => {
;() => va.track('get-in-touch-click')
track('feedback-open')
onOpenFeedbackDialog()
}, [onOpenFeedbackDialog])

Expand Down

1 comment on commit 1ee19c0

@vercel
Copy link

@vercel vercel bot commented on 1ee19c0 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.