AdTracker

Tracks events for media adverts.

A duration is required for tracking the ad completion percentage.

An ad view event is tracked on creation. The tracker is started in a paused state. If the ad is auto-played then you will need to call AdTracker.play to begin tracking engagement and ensure the completion event properties are correct.

The AdTracker.play and AdTracker.play functions are used to track playing and pausing of the ad. To track clicks use the AdTracker.clicked function.

Once the ad is complete call AdTracker.completion function. This will track a completion event with engagement properties added. The AdTracker instance will no longer track events after this has been called. To track new events please create a new AdTracker instance.

Types

Link copied to clipboard
class AdProperties @JvmOverloads constructor(val title: String? = null, durationInSeconds: Int? = null, val isMuted: Boolean? = null, val campaignId: String? = null, val creativeId: String? = null) : PermutiveParams

Model representing standard optional properties for all Ad events.

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun clicked()

Tracks the ad being clicked.

Link copied to clipboard
abstract fun completion()

Tracks the ad being complete. This means the ad is no longer being shown and there will be no more engagement with the ad.

Link copied to clipboard
abstract fun pause()

Tracks the ad being paused.

Link copied to clipboard
abstract fun play(positionMs: Long? = null)

Tracks the ad being played.

Link copied to clipboard
abstract fun track(eventName: String)

Tracks an event with no properties.

abstract fun track(eventName: String, properties: EventProperties?)

Tracks an event with optional properties.

Link copied to clipboard
abstract fun trackWithAdProperties(eventName: String)

Track a custom event with the ad properties included.

abstract fun trackWithAdProperties(eventName: String, customProperties: EventProperties)

Track a custom event with the ad properties included and the custom properties passed in.