Tracium
v1.2 Telemetry

Pageviews & Session Telemetry

Track stateless visitor sessions, return visit frequency, and W3C Navigation Timing waterfalls with zero client cookies or local storage persistence.

W3C Navigation Timing v2Stateless HMAC-SHA256Beacon: navigator.sendBeacon

Stateless Session Identification

Tracium eliminates client-side persistent cookies (e.g. _ga or tracking tokens) entirely. Instead, visitor identity and returning session affinity are calculated statelessly at ingestion:

session_id = Truncate64( HMAC_SHA256( Client_IP + UserAgent + Subnet24, Daily_Entropy_Salt ) )

The Daily_Entropy_Salt rotates every 24 hours UTC and is purged from memory. This cryptographic boundary prevents cross-day or cross-domain correlation while enabling accurate 24-hour unique visitor counts, session grouping, and repeat visitor loyalty percentages.

SPA Routing & History API Interception

For client-side rendered applications (Next.js App Router, Remix, Nuxt, Vite SPAs), the beacon wraps the native HTML5 History API:

History API Interception Specification
// Internal beacon instrumentation
const originalPushState = history.pushState;
history.pushState = function(...args) {
  originalPushState.apply(this, args);
  dispatchVirtualPageview(window.location.pathname);
};

window.addEventListener('popstate', () => {
  dispatchVirtualPageview(window.location.pathname);
});

Each route transition transmits path, query arguments (with sensitive parameter filtering), internal referrer, and page title.

W3C Navigation Timing & Latency Waterfalls

On initial document load, the client beacon queries the high-resolution PerformanceNavigationTiming entry:

DNS + Connect

connectEnd - domainLookupStart

Measures edge TLS termination and connection establishment.

Time to First Byte (TTFB)

responseStart - requestStart

Server processing latency and origin response transmission.

DOM Complete (FCP)

domContentLoadedEventEnd - responseEnd

Time required to parse HTML, execute deferred scripts, and paint.

Engagement Metrics & Beacon Unload Handlers

Engagement duration is recorded using the W3C Page Lifecycle API. When document.visibilityState === 'hidden' or when the window unloads, the accumulated active viewing interval is dispatched using navigator.sendBeacon(). This guarantees transport delivery even if the browser process terminates immediately.