...
Clients that are using JW Player or Brightcove OVPs and serving ads in-player using the IMA ad plugin can find documentation here:
Clients that are using a non-IMA ad plugin, not using Brightcove or JW Player, or serving their ads on-page instead of in-player should follow the instructions below.
Two Methods to Access Context
Get context information for an asset using the “getPlaylist” function.
Get context information using our built-in CustomParmas Function. (Does not support publishers with multiple players on a single page.)
...
Note: These both require using the “global” plugin option listed in Adaptive Plugin UI Settings and Customization Options under the header Advanced Options. Options should not include “enable_context_ads” or “enable_category_ads” when using custom integration.
Context using the “getPlaylist” Function
Using this requires using the “getPlaylist” and “getCurrentIndex” functions described here: Adaptive Plugin Development Options.
Retrieving the Context or IAB data
Once the plugin has loaded, you can get the ad context for the next video by checking the “getPlaylist” function.
...
As the viewer watches assets, you can check the current index of the player using “getCurrentIndex” and then request the context data for the next video in the playlist. An example of how to use “getCurrentIndex” to access the next video in the playlist can be found at Adaptive Plugin Development Options under the header Accessing the IRIS.TV Playlist.
Retrieving Context or IAB Data with a Multi-Player Pages
If you have multiple players on a page, then you should use the eID functionality documented here: Adaptive Plugin Development Options. This gives you the ability to specify a player instance with the global ID.
Here’s an example of how to use the eID functionality to pull context and IAB for the 1st recommended asset (with “iris” global_parameter set):
Query for the player’s eID:
...
NOTE: The IRIS Adaptive Playlist will update dynamically based on user interaction.
Populating the Ad Tag with Context or IAB Data
Once that data is pulled, you can add it to the ad tag URL. The “context” is used to populate the “cust_params” field in a DFP ad tag. The “iab” is then used to populate the “categories” field.
Context Using IRIS Adaptive Plugin’s CustomParms Function
Does not support publishers with multiple players on a single page.
...
Code Block |
---|
iris.addCustomParamsToUrl(adTagUrl, 'context', { index: 1, eid: 'iAxr' }); iris.addCustomParamsToUrl(adTagUrl, 'category', { index: 1, eid: 'iAxr' }); iris.addCustomParamsToUrl(adTagUrl, 'category_cust_params', { index: 1, eid: 'iAxr' }); |
Parameters Required for CustomParams function:
adTagUrl
REQUIRED: the ad tag that you want to populate the context or IAB data tocategory
orcontext
orcategory_cust_params
REQUIRED: specify if you want to add the “category” field with the IAB code OR if you want to add the “context” field in cust_params with the context hash. Last option is if you want to add the “category” field with the IAB code in the cust_params.extraParams
Optional: You can send an object containing the asset index or a different experience id, and you will use those values to populate the data,eid
is useful for when you have more than one player on the same page. If no index or eid is provided, the function will use the current playing asset and experienceId as the default.
...