(event: string, properties: Record<string, string>)
| 1 | import { track } from '@vercel/analytics' |
| 2 | |
| 3 | export 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 | } |
no outgoing calls
no test coverage detected