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
-
addGlobalContexts(
String tag, SelfDescribing context, {required String tracker}) → Future< void> -
Adds a global context with the given
tagto be attached to all tracked events for thetrackernamespace. -
createTracker(
{required String namespace, required String endpoint, Method? method, String? customPostPath, Map< String, String> ? requestHeaders, TrackerConfiguration? trackerConfig, SubjectConfiguration? subjectConfig, GdprConfiguration? gdprConfig, EmitterConfiguration? emitterConfig, GlobalContextsConfiguration? globalContextsConfig}) → 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
trackernamespace andidof 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.
-
removeGlobalContexts(
String tag, {required String tracker}) → Future< void> -
Removes global contexts with the given
tagfrom thetrackernamespace. -
setServerAnonymisation(
bool serverAnonymisation, {required String tracker}) → Future< void> -
Sets whether server-side anonymisation is enabled for the
trackernamespace. -
setUserAnonymisation(
bool userAnonymisation, {required String tracker}) → Future< void> -
Sets whether client-side user anonymisation is enabled for the
trackernamespace. -
setUserId(
String? userId, {required String tracker}) → Future< void> -
Sets the business user ID to the string for the
trackernamespace. -
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
trackernamespace 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.