UNPKG

@aws-amplify/analytics

Version:

Analytics category of aws-amplify

23 lines (22 loc) 1.02 kB
import { PageViewTrackingOptions, TrackerEventRecorder, TrackerInterface } from '../types/trackers'; export declare class PageViewTracker implements TrackerInterface { private trackerActive; private options; private eventRecorder; /** * `sessionStorage` key used to persist the last-recorded URL. It is * namespaced per provider so that concurrent trackers (e.g. Pinpoint + * Kinesis) each keep their own "previous URL" and every provider records the * page view, rather than the first tracker clobbering the shared key and the * rest silently skipping the event. */ private readonly storageKey; private spaTrackingActive; constructor(eventRecorder: TrackerEventRecorder, options?: PageViewTrackingOptions, namespace?: string); configure(eventRecorder: TrackerEventRecorder, options?: PageViewTrackingOptions): void; cleanup(): void; private setupSPATracking; private setupMPATracking; private handleLocationChange; private urlHasChanged; }