Skip to content

Commit

Permalink
Feat: Add ga events
Browse files Browse the repository at this point in the history
  • Loading branch information
Ho-s committed Sep 2, 2024
1 parent 0b4281e commit 9750d6e
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 0 deletions.
120 changes: 120 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/app/place/[placeId]/place-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { api } from '@/utils/api'
import { formatDistance, getDistance } from '@/utils/location'
import { roundToNthDecimal } from '@/utils/number'
import { allowUserPositionStorage } from '@/utils/storage'
import { sendGAEvent } from '@next/third-parties/google'

interface PlaceBoxProps {
place: PlaceDetail
Expand Down Expand Up @@ -133,6 +134,11 @@ const PlaceBox = ({ place, mapId }: PlaceBoxProps) => {

const handleRegisterPlace = async () => {
try {
sendGAEvent({
category: 'place',
action: 'click',
label: 'register',
})
router.push(`/place/${place.kakaoId}/register`)
revalidate(['places', mapId])
} catch (error) {
Expand Down
7 changes: 7 additions & 0 deletions src/components/boarding-pass/inviting-boarding-pass.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client'

import { sendGAEvent } from '@next/third-parties/google'
import BoardingBottom from './boarding-bottom'
import BoardingDivider from './boarding-divider'
import InviteBoardingPassInfo from './invite-boarding-pass-info'
Expand All @@ -22,6 +23,12 @@ const InvitingBoardingPass = ({

const handleClickShareButton = () => {
shareInvite(inviteCode, expirationTime)

sendGAEvent({
category: 'invitation',
action: 'click',
label: 'invitation',
})
}

return (
Expand Down

0 comments on commit 9750d6e

Please sign in to comment.