From 9750d6eb200c968bb89c2fee6b086e4a9210be35 Mon Sep 17 00:00:00 2001 From: Joo-Byungho Date: Mon, 2 Sep 2024 14:24:53 +0900 Subject: [PATCH] Feat: Add ga events --- package-lock.json | 120 ++++++++++++++++++ src/app/place/[placeId]/place-box.tsx | 6 + .../boarding-pass/inviting-boarding-pass.tsx | 7 + 3 files changed, 133 insertions(+) diff --git a/package-lock.json b/package-lock.json index 002b9479..705ab1f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19992,6 +19992,126 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.3.tgz", + "integrity": "sha512-6adp7waE6P1TYFSXpY366xwsOnEXM+y1kgRpjSRVI2CBDOcbRjsJ67Z6EgKIqWIue52d2q/Mx8g9MszARj8IEA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.3.tgz", + "integrity": "sha512-cuzCE/1G0ZSnTAHJPUT1rPgQx1w5tzSX7POXSLaS7w2nIUJUD+e25QoXD/hMfxbsT9rslEXugWypJMILBj/QsA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.3.tgz", + "integrity": "sha512-0D4/oMM2Y9Ta3nGuCcQN8jjJjmDPYpHX9OJzqk42NZGJocU2MqhBq5tWkJrUQOQY9N+In9xOdymzapM09GeiZw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.3.tgz", + "integrity": "sha512-ENPiNnBNDInBLyUU5ii8PMQh+4XLr4pG51tOp6aJ9xqFQ2iRI6IH0Ds2yJkAzNV1CfyagcyzPfROMViS2wOZ9w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.3.tgz", + "integrity": "sha512-BTAbq0LnCbF5MtoM7I/9UeUu/8ZBY0i8SFjUMCbPDOLv+un67e2JgyN4pmgfXBwy/I+RHu8q+k+MCkDN6P9ViQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.3.tgz", + "integrity": "sha512-AEHIw/dhAMLNFJFJIJIyOFDzrzI5bAjI9J26gbO5xhAKHYTZ9Or04BesFPXiAYXDNdrwTP2dQceYA4dL1geu8A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.3.tgz", + "integrity": "sha512-vga40n1q6aYb0CLrM+eEmisfKCR45ixQYXuBXxOOmmoV8sYST9k7E3US32FsY+CkkF7NtzdcebiFT4CHuMSyZw==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.3.tgz", + "integrity": "sha512-Q1/zm43RWynxrO7lW4ehciQVj+5ePBhOK+/K2P7pLFX3JaJ/IZVC69SHidrmZSOkqz7ECIOhhy7XhAFG4JYyHA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } } } } diff --git a/src/app/place/[placeId]/place-box.tsx b/src/app/place/[placeId]/place-box.tsx index 9f7ad0b7..e404b431 100644 --- a/src/app/place/[placeId]/place-box.tsx +++ b/src/app/place/[placeId]/place-box.tsx @@ -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 @@ -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) { diff --git a/src/components/boarding-pass/inviting-boarding-pass.tsx b/src/components/boarding-pass/inviting-boarding-pass.tsx index 4e014228..9cf9e069 100644 --- a/src/components/boarding-pass/inviting-boarding-pass.tsx +++ b/src/components/boarding-pass/inviting-boarding-pass.tsx @@ -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' @@ -22,6 +23,12 @@ const InvitingBoardingPass = ({ const handleClickShareButton = () => { shareInvite(inviteCode, expirationTime) + + sendGAEvent({ + category: 'invitation', + action: 'click', + label: 'invitation', + }) } return (