...
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.)
Both of these methods support access to the “context” and “iab” fieldsfield. The Context field will contain an encrypted context segments as a comma-separated string (ex. “e883d22ce29c85f9e910281d2a410c5bad77a098”). The IAB field will contain an IAB code (ex. “IAB17-26”). Please check with your IRIS.TV representative on which field will be used for your assets’ context.
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
...
Segment
Once the plugin has loaded, you can get the ad context for the next video by checking the “getPlaylist” function.
Here’s an example of pulling the context and IAB segment for the 1st recommended asset (with “iris” global_parameter set):
Code Block |
---|
const playlistItem = iris.getPlaylist()[1];
playlist.context // context: ["e883d22ce29c85f9e910281d2a410c5bad77a098"]
playlist.iab // iab: ["IAB17-26"] |
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
...
Segment 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
...
for the 1st recommended asset (with “iris” global_parameter set):
Query for the player’s eID:
...
Code Block |
---|
const playlistItem = iris.getPlaylistByEid("gXKM"))[1];
playlist.context // context: ["e883d22ce29c85f9e910281d2a410c5bad77a098"]
playlist.iab // iab: ["IAB17-26"] |
NOTE: The IRIS Adaptive Playlist will update dynamically based on user interaction.
Populating the Ad Tag with Context
...
Segments
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.
If you aren’t able to manually add the data to the ad tag URL, the IRIS adaptive plugin has a function to populate that data for you. This function is addCustomParamsToUrl
. You can send in a tag along, specify if that you want to populate context in the cust_params
parameter or populate iab
in the categories
parameter.
The function looks like this:
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 append the context or IAB data segment to.category
orcontext
orcategory_cust_params
REQUIRED: specify if you want to add the “category” field with the IAB code OR if REQUIRED: Specify that 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.
...