04. Analytics Sentry/Event Ingestion

Event Ingestion & Taxonomy

Learn how GN-Apex tracks page views, interactive clicks, e-commerce purchases, and custom user properties through an offline-resilient client pipeline.

OFFLINE RESILIENCE
500 Events
Crash-Proof IndexedDB Buffer

Events captured during offline periods are queued in IndexedDB and automatically flushed upon reconnection.

Zero Data Loss Guarantee
POST/api/collect

Standard Event Taxonomy

The platform categorizes events into distinct analytical domains:

TRAFFIC

page_view

Captured on route transitions with referrer and search params.

INTERACTION

click & scroll

Link/button clicks with element IDs, dataset tags, and depth percentiles.

COMMERCE

purchase

Order IDs, revenue, SKU arrays, and conversion values.

IDENTITY

identify & alias

Stitching anonymous hardware fingerprints to named user accounts.

PERFORMANCE

vitals & rum

Core Web Vitals, resource waterfails, and navigation timing.

MEDIA

video_play & pause

Media engagement, 50% milestone tracking, and duration metrics.

Analytics Payload Schema

Every event packet transmitted to POST /api/collect adheres to this contract:

ParameterTypeRequirementDescription
projectIdstringRequiredTarget Project Node ID.
sessionIdstringRequiredSession identifier (rotates after 30 mins of inactivity).
visitorIdstringRequiredDeterministic hardware/canvas hash.
messageIdstringRequiredRFC4122 UUID to deduplicate events.
eventTypestringRequiredSnake_case event type (page_view, click, purchase).
eventNamestringOptionalCustom event label (e.g. 'cta_clicked').
eventDataRecord<string, any>OptionalArbitrary JSON metadata payload.
ecommerceEcommercePayloadOptionalStructured cart/order payload.
performancePerformanceMetricsOptionalRUM metrics and timing snapshots.
clientTimestampISO-8601 DateRequiredClient clock time (validated against server drift).

Offline Storage & Queue Buffering

The SDK includes a built-in EventStorage class backed by IndexedDB:

  • Queue Flushing: Flushes every 5 seconds, when queue count reaches 10, on page hide (visibilitychange), or immediately on purchase and identify events.
  • Disk Protection: Capped at 500 events. If an extended offline period occurs, the oldest events are evicted to make room for fresh interactions.

SDK Tracking Methods

1import { nexus } from "@nexushub/client";
2 
3// Track custom user interactions
4nexus.analytics?.track("newsletter_subscribed", {
5 plan: "enterprise",
6 source: "footer_modal",
7});