To enable a Datazoom collector to capture the ad related data points, the required steps for a web application differ depending on how the ad framework (e.g., Freewheel) is integrated with the video player. In general, there are two types of integration method between the video player and ad framework:
1. Leverage ad framework integration supported by the video player
Players such as Akamai AMP player, JW Player, THEOplayer, … etc., support Freewheel ad integration as a part or an optional module of the player. Since the corresponding Datazoom collector for the player is prebuilt with knowledge of the player’s ad related features, for a web application who simply leverages the video player for ads, no additional code is required to enable ad data collection in this scenario.
A web application may choose to utilize the video player for the purpose of content presentation only, while building its own ad implementation by utilizing the ad framework directly. In these use cases, the video player has no awareness of the ad implementation and therefore it will fall under the second scenario described below.
2. Ad implementation external to the video player
Players that mainly focus on core playback/streaming functionalities, such as HLS.js player, Dash.js player, or the native HTML5 <video> element, often do not come with ad integration features. For a web application who likes to enable ads independent of the video player, it can choose to utilize the ad framework library (e.g., Freewheel MRM AdManager SDK) directly or bring in some third-party components. In either cases, since it is impossible for the corresponding Datazoom collector to gather ad information through the video player, some provisioning steps (see the section below: Attach the Freewheel Context) will be required to enable ad data collection.
Attach the Freewheel Context
For a web application who enables ads by utilizing Freewheel MRM AdManager SDK directly or through some third-party components, it will be interacting with the Freewheel Context object. This object is responsible for creating ad requests, parsing the ad request responses, and managing the presentation of the resulted ads. Besides, the Freewheel Context object also provides events and metadata regarding the resulted ads and the presentation status.
Therefore, for a Datazoom collector to gather ad information in this scenario, the application should give access by attaching the Freewheel Context object to the collector context as soon as it becomes available. The Datazoom collector context interface expose these methods for this purpose:
For example, a video page using HTML5 <video> element and managing Freewheel MRM AdManager SDK directly can set everything up and attach the Freewheel Context object (to the collector context) as below:
That’s it. The Datazoom collector is now provided with the required access to gather ad related information.
If some third-party component is used to add ad implementation, the best way to enable ad data collection is by querying the underlying Freewheel Context object and attaching it to the collector context in the same way as described above.