Typically for a web application to play content with the Server-Side Ad Insertion (SSAI) service provided by MediaTailor, first it sends a session initialization HTTP request in order to receive the URL for the video stream with server-side ads inserted, as well as the ad tracking URL which is used for ad information polling. For example:
If the session initialization request is successful, the manifest URL for playing video (with server-side ads inserted) is converted to absolute URL and loaded into the player for content/ads presentation.
To an uninformed player or player data collector, the server-side inserted ads are indistinguishable from real contents under the same video stream. For a Datazoom collector to identify these ads and report ad data points accordingly, it must be given access to the ad tracking URL in order to derive the extra information needed for handling SSAI ads. This is discussed in the next section.
Attach the Ad Tracking URL
As in most Datazoom collector integrations, as soon as a player instance is created, a Datazoom collector context is created in order to collect data for this specific player. Now, we must perform one additional context method call to give the Datazoom collector context the access to the ad tracking URL.
The context method is named
attachMediaTailorTrackingURL() and it takes two parameters: the ad tracking URL and the desired ad information polling interval in seconds. It should be called as soon as session initialization is finished, as demonstrated in the following example:
As suggested by MediaTailor, the ad information polling should happen at least once per manifest duration.
That’s it. The Datazoom collector is now provided with the required access to gather SSAI ad related information.