AdswizzTrackingEngine

Engine responsible for firing ad-tracking events. e.g: impressions, quartiles, errors, custom events, etc.

Each method takes a serialized payload resulted from the AdRequest and an optional MacroContext used to expand any macros (e.g. [MEDIAPLAYHEAD],[ADPLAYHEAD]) present in the tracking URLs before they are fired.

Instances are obtained through Builder class or the AdswizzTrackingEngine.DEFAULT configuration.

Example:

val engine = AdswizzTrackingEngine.Builder()
.withAutomaticTrackingDecisions(TrackingPolicy.ValidatedTrackingPolicy)
.withHttpConfig(myHttpConfig)
.build()

val updatedPayload = engine.started(payload, elapsedTime, macroContext)

The tracking engine methods will return an updated payload reflecting the modified ad state by the SDK

Types

Link copied to clipboard
class Builder

Builder for AdswizzTrackingEngine instances.

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun ended(payload: ByteArray, elapsedTime: Duration?, reason: AdReasonType, macroContext: MacroContext?): ByteArray

Java-friendly overload of ended accepting a java.time.Duration.

abstract fun ended(payload: ByteArray, elapsedTime: Duration?, reason: AdReasonType, macroContext: MacroContext?): ByteArray

Signals the end of the ad with a specified reson type.

Link copied to clipboard
abstract fun error(payload: ByteArray, elapsedTime: Duration?, macroContext: MacroContext?): ByteArray

Java-friendly overload of error accepting a java.time.Duration.

abstract fun error(payload: ByteArray, elapsedTime: Duration?, macroContext: MacroContext?): ByteArray

Fires the error tracking URLs for the ad described by payload.

Link copied to clipboard
abstract fun onEvent(payload: ByteArray, elapsedTime: Duration?, event: AdEventType, macroContext: MacroContext?): ByteArray

Java-friendly overload of onEvent accepting a java.time.Duration.

abstract fun onEvent(payload: ByteArray, elapsedTime: Duration?, event: AdEventType, macroContext: MacroContext?): ByteArray

Fires the tracking URLs associated with the given event (e.g. pause, resume, mute, click).

Link copied to clipboard
abstract fun progress(payload: ByteArray, elapsedTime: Duration, macroContext: MacroContext?): ByteArray

Java-friendly overload of progress accepting a java.time.Duration.

abstract fun progress(payload: ByteArray, elapsedTime: Duration, macroContext: MacroContext?): ByteArray

Fires any quartile / progress tracking URLs whose threshold has been reached at elapsedTime.

Link copied to clipboard
abstract fun started(payload: ByteArray, elapsedTime: Duration?, macroContext: MacroContext?): ByteArray

Java-friendly overload of started accepting a java.time.Duration.

abstract fun started(payload: ByteArray, elapsedTime: Duration?, macroContext: MacroContext?): ByteArray

Signals the beginning of the ad.