type PageTrackingProperties = Record; /** * Tracks a Segment `page()` event. * * Two call shapes: * * 1. `usePageTracking(path)` — fires `page(path)` whenever `path` changes. * Backwards-compatible with the original signature. * * 2. `usePageTracking(name, properties)` — fires `page(name, properties)` only * once analytics is available AND `name` is a non-empty string. Use this * shape when the page title is resolved asynchronously (e.g. from a CMS via * Helmet + RTK Query) so the event lands AFTER `document.title` updates, * avoiding the SPA race that lets Segment auto-capture the previous route's * title via `properties.title`. * * Both shapes wait for analytics to be AVAILABLE, not fully initialized: once * the instance exists a page view is buffered while Segment loads and sent when * it is ready, so a route the visitor leaves in-app before then still counts. * Before that (`page` is the no-op fallback) the call is skipped and fires when * analytics becomes available. */ declare function usePageTracking(path: string): void; declare function usePageTracking(name: string | undefined, properties?: PageTrackingProperties): void; export { usePageTracking };