AttributionContext class

Last-click attribution + session tracking for in-app events.

LinkForty attributes in-app activity (events and screen views) to the deep link that drove it, using a last-click + window model:

  • Every deep-link open (deferred install OR direct re-engagement) pins an active context to THAT link. The newest open wins (supersede).
  • Every event is stamped with the active context so the backend can credit the link. The conversion window and session grouping are applied server-side at query time — the SDK only reports the active link, when it opened, and the current session.
  • A sessionId identifies one app-open journey: generated on cold start and rotated on each new deep-link open.

The active context is persisted so a reopen without a new click still attributes to the last link. The session is in-memory: a cold start is a new session.

Constructors

AttributionContext({required StorageManagerProtocol storage, bool debug = false})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionId String
The current session id (one app-open journey).
no setter

Methods

clear() Future<void>
Clears the persisted context and starts a fresh session (used by clearData).
getStamp() AttributionStamp
The attribution fields to merge into every event payload.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordDeepLinkOpen({String? linkId, String? clickId}) Future<void>
Records a deep-link open. The newest open supersedes the previous one (last-click) and starts a new session. A no-op when no linkId is known (organic/unresolved open) — there is nothing to attribute to.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited