The HTML Video module enables the ad to send video-related metrics to the server for use in reports, while using the native browser player.
Follow these steps to use the Video module.
-
Before the AdKit declaration in our HTML files, you must include modules and declare them in an array variable called
EBModulesToLoad
.The following example loads the Video module for use in an AAS ad.
<script>EBModulesToLoad = ['Video'];</script>
Note
Note: if you add multiple modules within the same ad, the Video one must be placed at the beginning.
-
Use the following code to link the HTML video element to the video module. (This example assumes
videoElement
is a variable that points to the HTML video element to track.)var videoTrackingModule = new EBG.VideoModule(videoElement);
After this procedure, tracking the video is done automatically, with two exceptions:
-
There is only support for the full-screen API in WebKit-supported browsers (Chrome, Safari, Edge).
-
If you want your reports to distinguish between auto-initiated and user-initiated video, you can specify that the video was started with a user interaction by calling the
.playVideo()
method. Video is typically tracked as auto-initiated because the module cannot intercept clicks on the native HTML video-player controls.
Important
Important: Please note that if you are using a dynamic video element, it will be tracked automatically. You should not manually include or initialize the Video Module, as this can result in duplicate tracking of video progress and events.
Causes the video to start playing, allowing it to be tracked as user-initiated.
Event Name |
Description and Usage (to trigger event manually) |
---|---|
FULLPLAY |
Fired when the video has reached the end.
|
FULLSCREEN_END |
Fired when the video plays to the end while the player is in full-screen mode.
|
FULLSCREEN_MUTE |
Fired when the video is muted while the player is in full-screen mode.
|
FULLSCREEN_PAUSE |
Fired when the video is paused while the player is in full-screen mode.
|
FULLSCREEN_START |
Fired when a video is started for the first time while the player is in full-screen mode.
|
MUTE |
Fired when the video is muted.
|
PAUSE |
Fired when the video is paused.
|
PERCENT_25_PLAYED |
Fired when the video has reached the first quartile.
|
PERCENT_50_PLAYED |
Fired when the video has reached the second quartile.
|
PERCENT_75_PLAYED |
Fired when the video has reached the third quartile.
|
REPLAY |
Fired when the video is replayed after the first full play.
|
SLIDER_DRAGGED |
Fired when the user completed dragging the video play head to a new position.
|
STARTED |
Fired when a video started playing for the first time.
|
UNMUTE |
Fired when video is unmuted.
|
UNMUTED |
Fired when the video is not muted alongside the video started event.
|
USER_INITIATED_VIDEO |
Fired when the video is started by a user. This event is only tracked once per impression.
|
Comments