Skip to content

v1.7.0

Latest

Choose a tag to compare

@cemardafil cemardafil released this 23 Sep 11:32
242e0e0

Session Tracking

Every event now carries its analytics session at context.providers.metarouter.{sessionID, sessionCount} — the same path and shape as the web SDK's MetaRouter session, so pipeline mappings (e.g. GA4 session_id/session_number) read one field from every platform.

  • Always on: sessions are minted lazily by the first event, extend on any activity (native, lifecycle, or webview-bridge events), and end after sessionTimeoutMinutes (default 30) of inactivity. The window slides; sessions survive process restarts inside the window and reset().
  • InitOptions.sessionTimeoutMinutes (default 30, clamped-with-warning) and InitOptions.fireSessionStarted (default false) — enabling emits a Session Started track event each time a new session is minted, for destinations that need an explicit session-start signal (GA4 session_start).
  • getSessionId() async -> String? on the analytics interface (nil before the first event; reads never start or extend a session); sessionId/sessionCount in getDebugInfo().

Backwards-compatible: events queued on disk by earlier versions decode unchanged; no event volume changes unless fireSessionStarted is enabled. E2E verified against a production-shape cluster (mint / restart-resume / rollover, payload audit).

PRs: #56, #57, #58 · bump #60

Full Changelog: v1.6.0...v1.7.0