Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview: The Context Script gives publishers the ability to retrieve Context Data Segments and IAB category information on a given asset. This is meant to be used as a part of your ad workflow to send context data through your ad server. This documentation will walk through how clients using the Adaptive Plugin can add the Context Script and retrieve context or IAB category for the initial asset and IRIS.TV recommendations.

...

  1. IRIS.TV Context Script is loaded with the page.

  2. The context script is initialized.

  3. Call script getVideoInfo route to retrieve the context and IAB data segments for the initial asset ID.

  4. Add either the context or IAB category information segment to the pre-roll ad tag for the initial asset ID. Please confirm with your account manager which field will be used for your integration.

  5. Call script method to retrieve context or IAB data segments for all Adaptive Plugin recommendations and store data on the client-side.

  6. Add context or IAB category information segments to the pre-roll for 1st recommendation.

...

Once the script is initialized, you can send in the video ID of the initial video to retrieve context and IAB category informationsegments.

Please confirm with your IRIS.TV Account Manager:

  • If your integration is using context or IAB category information.

  • Where the field context segments should be added within the ad tag (i.e. in the “cust_params” field in a DFP tag).

Initial Video: Using the getVideoInfo route to retrieve context

...

segments

Parameters for this getVideoInfo route

...

  1. Send platform_id to getVideoInfo route.

  2. Retrieve context or IAB categories segments from getVideoInfo,.

  3. Send context or IAB categories segments in the pre-roll ad call for the initial video.

...

Code Block
IrisContext.getVideoInfo('<platform_id of the initial video>', function(data) { 
  // data is ready to be used
  // where data is an object of the form { context: [‘context-value’], categories: [‘iab-value’], platform_id: 'platform-id-value' }
  console.log(data.context);
  console.log(data.categories);
});

...

Code Block
{
  platform_id: '6026440620001',
  categories: ["IAB17-26"],
  context: ["e883d22ce29c85f9e910281d2a410c5bad77a098"]
} 

Recommended Videos: Using the getRecommendationInfo route to retrieve context

...

segments

Steps

  1. Call getRecommendationsInfo route as a part of callbacks for IRIS.TV /watch and /next API routes, which are exposed through the irisResponseReady event.

    1. You only need to create this event along with the getRecommendationsInfo route once

    2. You need to send the e.detail.platform_id value as shown below

  2. Store data returned from getRecommendationsInfo so it can be used to retrieve data each recommended video.

  3. On video load, query player for ID of the video and then query stored platform_id values for context or IAB categoriessegments.

  4. Send context of IAB category segments data in the pre-roll ad call for the video.

...

Code Block
window.addEventListener('irisResponseReady', function (e) {
 IrisContext.getRecommendationsInfo(e.detail.platform_id).then(function(data) {
   // <data> will contain the information in the form of:
   /* {
       <platform_id>: { context: <value>, categories: <value> },
       <platform_id>: { context: <value>, categories: <value> },
      }
    */
 });
});