Snowplow class Getting started Initialization and configuration

Main interface for the package mainly used to initialize trackers and track events.

Constructors

Snowplow()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

createTracker({required String namespace, required String endpoint, Method? method, String? customPostPath, Map<String, String>? requestHeaders, TrackerConfiguration? trackerConfig, SubjectConfiguration? subjectConfig, GdprConfiguration? gdprConfig, EmitterConfiguration? emitterConfig}) Future<SnowplowTracker>
Creates a new tracker instance with the given unique namespace.
endMediaTracking({required String tracker, required String id}) Future<void>
Ends media tracking with the given tracker namespace and id of the media tracking.
getSessionId({required String tracker}) Future<String?>
Returns the identifier (string UUIDv4) for the session.
getSessionIndex({required String tracker}) Future<int?>
Returns the index (number) of the current session for this user.
getSessionUserId({required String tracker}) Future<String?>
Returns the identifier (string UUIDv4) for the user of the session.
setUserId(String? userId, {required String tracker}) Future<void>
Sets the business user ID to the string for the tracker namespace.
startMediaTracking({required String tracker, required MediaTrackingConfiguration configuration}) Future<MediaTracking>
Starts media tracking with the given configuration.
track(Event event, {required String tracker, List<SelfDescribing>? contexts}) Future<void>
Tracks the given event using the specified tracker namespace and with optional context entities.
trackMediaEvent({required String tracker, required String id, required Event event, List<SelfDescribing>? contexts, MediaPlayerEntity? player, MediaAdEntity? ad, MediaAdBreakEntity? adBreak}) Future<void>
Tracks a media player event along with the media entities (e.g., player, session, ad).
updateMediaTracking({required String tracker, required String id, MediaPlayerEntity? player, MediaAdEntity? ad, MediaAdBreakEntity? adBreak}) Future<void>
Updates stored attributes of the media player such as the current playback. Use this function to continually update the player attributes so that they can be sent in the background ping events.