MediaTracker
Tracks events based on interactions with media content. Engagement with content is tracked based on the time spent consuming the content and what percentage of the content is consumed if the content has a finite duration.
Upon stopping the content a completion event will be sent.
The MediaTracker is an EventTracker and can track custom events which will be associated with the current media content.
The media tracker tracks an initial view event on creation and starts in a paused state. Engagement will not be tracked until play is called.
For media content of an unknown length use the MediaTracker.UNKNOWN_DURATION constant as the duration.
Types
Properties describing the page hosting the video (if relevant)
Standard properties on all video events. All properties are optional.
Functions
Set the duration in milliseconds of the content. This needs to be set before the video is stopped to be reflected in the completion event.
Tracks an ad view and returns an AdTracker. The initial ad view event and all other ad events tracked with the ad tracker will share the view ID of the events tracked through this MediaTracker instance.
Tracks a custom event with the media properties attached. MediaTracker.VideoProperties for video tracking.
Tracks a custom event with the media properties attached and optional custom properties. MediaTracker.VideoProperties for video tracking.