mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 23:14:37 +00:00
14 lines
379 B
TypeScript
14 lines
379 B
TypeScript
import { useEffect } from 'react';
|
|
import { useLocation } from 'react-router-dom';
|
|
|
|
import { trackPageView } from '../../services/analytics';
|
|
|
|
/** Standard route-view tracker. Mount once inside the active router. */
|
|
export function AnalyticsPageTracker() {
|
|
const { pathname } = useLocation();
|
|
useEffect(() => {
|
|
trackPageView(pathname);
|
|
}, [pathname]);
|
|
return null;
|
|
}
|