MCPcopy
hub / github.com/RealKai42/qwerty-learner / trackPromotionEvent

Function trackPromotionEvent

src/utils/trackEvent.ts:3–17  ·  view source on GitHub ↗
(event: string, properties: Record<string, string>)

Source from the content-addressed store, hash-verified

1import { track } from '@vercel/analytics'
2
3export const trackPromotionEvent = (event: string, properties: Record<string, string>) => {
4 track(event, properties)
5
6 // @ts-expect-error gtag is not defined in the window object
7 if (typeof window !== 'undefined' && window?.gtag) {
8 try {
9 window.gtag('event', event, { ...properties })
10 if (properties.action_detail) {
11 window.gtag('event', properties.action_detail)
12 }
13 } catch (error) {
14 console.error(error)
15 }
16 }
17}

Callers 3

handleTryNowFunction · 0.90
handleDismissFunction · 0.90
DictRequestFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected