When client ad tracking is enabled, the player is responsible for triggering ad tracking events. You can find client-side tracking information in the interstitials object returned when the VOD session is created.
The interstitials object includes ad tracking information and metadata for companion ads parsed from ad tag requests. To inspect which ads are stitched, see Inspect a VOD session.
Before you begin
Make sure you are familiar with the steps to create a VOD session using the Video Stitcher API. For more information, see Create a VOD session.
Interstitials
Ad tracking information is grouped by ad breaks in the interstitials
object.
Ad breaks may have progress events which specify the event URI and the time
offset relative to the break start time for each event that has been fired. For
more details about progress events, see the
ProgressEvent
reference documentation.
Ad breaks may also have activity events and companion ads. For more details
about companion ads, see the
CompanionAds
reference documentation.
An interstitials example can be found below:
{
"adBreaks": [
{
"progressEvents": [
{
"timeOffset": "0s",
"events": [
{
"type": "IMPRESSION",
"uri": "https://example.com/impression"
},
{
"type": "START",
"uri": "https://example.com/start"
}
]
},
{
"timeOffset": "1.250s",
"events": [
{
"type": "FIRST_QUARTILE",
"uri": "https://example.com/firstquartile"
}
]
}
],
"ads": [
{
"duration": "5s",
"activityEvents": [
{
"type": "PAUSE",
"uri": "https://example.com/pause"
}
],
"companionAds": {
"required": "all",
"companions": [
{
"width": 200,
"height": 100,
"staticResource": {
"uri": "https://example.com/static.png",
"creativeType": "image/png"
}
}
]
}
},
{
"duration": "10s"
}
],
"startTimeOffset": "0s",
"endTimeOffset": "15.000s"
}
],
"sessionContent": {
"duration": "120.000s"
}
}
In the example above, there is one pre-roll ad break with two ads stitched into
a VOD asset. The duration of the first ad is 5 seconds and the duration of the
second ad is 10 seconds. The total stitched video length is 120 seconds, as
identified by the duration
field in sessionContent
.
When the client receives this object, it should do the following:
- Make a request to
https://example.com/start
at the start of the ad break. - Make a request to
https://example.com/impression
at the start of the ad break. - Make a request to
https://example.com/pause
whenever the viewer pauses the video during the first ad. - Make a request to
https://example.com/firstQuartile
1.25 seconds into the first ad. - Load the companion ad
https://example.com/static.png
during the first ad.
For more details about interstitials, see the interstitials reference documentation.