Files
dukang/apps/h5-shop/src/lib/usePageView.ts
T
jacy 89fd333702 feat(analytics): persona logging upgrade and Sentry system config
Add client-logging SDK, expanded event taxonomy, API observability, admin domain events UI, and move SENTRY_DSN to HQ system settings with @sentry/node bootstrap after config preload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 22:30:02 +08:00

12 lines
362 B
TypeScript

import { useEffect, useRef } from 'react';
import { trackStorePageView } from './analytics';
export function useStorePageView(eventName: string, params?: Record<string, unknown>) {
const fired = useRef(false);
useEffect(() => {
if (fired.current) return;
fired.current = true;
trackStorePageView(eventName, params);
}, [eventName, params]);
}