(pageName: string, properties?: Record<string, any>)
| 354 | } |
| 355 | |
| 356 | export function usePageView(pageName: string, properties?: Record<string, any>) { |
| 357 | const hasTracked = useRef(false); |
| 358 | |
| 359 | useEffect(() => { |
| 360 | if (!hasTracked.current && analytics.isEnabled()) { |
| 361 | analytics.track('$pageview', { |
| 362 | page_name: pageName, |
| 363 | ...properties, |
| 364 | }); |
| 365 | hasTracked.current = true; |
| 366 | } |
| 367 | }, [pageName, properties]); |
| 368 | } |
| 369 | |
| 370 | export function useAppLifecycle() { |
| 371 | useEffect(() => { |