DVAttribution class final
This device's first and last touch. See the library documentation.
Constructors
- DVAttribution({required DVAttributionStorage storage, DateTime clock()?, Duration firstTouchFor = const Duration(days: 90)})
Properties
- firstTouch → DVTouch?
-
The first visit this device made within firstTouchFor.
no setter
- firstTouchFor → Duration
-
How long a first touch stands before a later visit may replace it.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastTouch → DVTouch?
-
The latest visit that brought a campaign, a click id or another site's
referrer; the first visit until there is one.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- visit → DVTouch?
-
This page load's own touch, when it brought a campaign, a click id or
another site's referrer. What a page view reports as its campaign.
no setter
Methods
-
capture(
Uri page, {String? referrer}) → void -
Reads
pageas the landing of a visit, linked fromreferrer. Only the first call does anything: the landing is the one address that carries the campaign. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
{firstTouch: {...}, lastTouch: {...}}, plain data for a backend call. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- current → DVAttribution
-
This process's attribution, over the platform's storage. In a browser
the page's landing address is captured the first time this is read.
no setter
Static Methods
-
captureLanding(
) → void - Captures the address the browser landed on and the page that linked to it. Does nothing outside a browser, and nothing after the first call: the generated client calls it as it starts, before a route change can take the campaign out of the address.
-
resetForTest(
) → void - Forgets current, for tests.
Constants
- storageKey → const String
- The name the touches are kept under.