PubMatic: Passing Contextual Data

This page details how to format the iris_context and iris_id KVPs in the Prebid, OpenRTB and PubMatic tag based integrations.

Prebid.org Integration

Prebid integration leverages the custom KVP object to pass in the iris_context and iris_id KVPs. Here's the documentation from PubMatic on how to format custom KVPs in Prebid: https://docs.prebid.org/dev-docs/bidders/pubmatic.html

  • Contextual segment: pass in the bids.params.dctr field
  • iris_id: pass in the content.id field using the ortb2.site object

See this example:

var adUnits = [

{

    code: 'test-div', 

    sizes: [

        [300, 250],

        [728, 90]

    ],  

    bids: [{

      bidder: 'pubmatic',

      params: {

        publisherId: '123456',            

        adSlot: 'pubmatic_test2',         

        dctr: 'iris_context=ic_4146983'

      }

    }]

}];




   pbjs.setConfig({

ortb2:{

site:{
                
content: {

                       id: "iris_5e709178df9352dc",

                       title: "[title]",

                       series: "[series]",

                       cat: "[category]",

                       contentrating: "TV - PG",

                       context: 1,

                       producer: "[producer]",

                       id: "[network]",

                       name: "[network_name]"

                       len: "[seconds]",

                       genre: "Comedy"

}

}

        }

     });

Your Price Bucket Line items would need to also be updated to pass the values

oRTB Integration

The OpenRTB integration leverages the custom KVP object to pass in the iris_context and iris_id KVPs.

  • Contextual segments: pass in the site object extension field, using attribute key_val.
  • iris_id: pass in the content object id attribute

Here is an example for how PubMatic requires publishers to format custom KVPs in OpenRTB:

   "site": {

        "ext": {

           "key_val": "iris_context=ic_4146983"

        }

    },

"content": {

    "id": "iris_5e709178df9352dc",

     },

 },

 

Tag Integration

The tag integration leverages the custom key-value pair formatting to pass in the iris_context and iris_id KVP. 

  • contextual Segments: pass information as key values. Pass the values behind the "iris_context" key
    • key values to be passed as dctr parameter as follows:  dctr=ENCODED<key1=V1,V2,V3|key2=v1|key3=v3,v5>
  • iris_id: pass the ID using parameter cntid

See this example:

http://vid.pubmatic.com/AdServer/AdServerServlet?adtype=13&pubId=123456&siteId=

098765&adId=2345678&vadFmt=2&vminl=2&vmaxl=6&vh=PLAYER_HEIGHT&vw=PLAYER_WIDTH&dctr=iris_context%3DIC_1234%2Cic_4146983&cntid=iris_5e709178df9352dc


Here is additional documentation from PubMatic on how to format custom KVPs in the ad tag: https://community.pubmatic.com/display/AN/Custom+key-value+pairs

SpringServe HB Integration

The IRIS_CONTEXT values can be passed to PubMatic's dctr parameter using SpringServe's {{IRIS_CONTEXT}} macro.

This can be done by selecting the dctr parameter under the Optional Parameters dropdown on a PubMatic demand tag and placing the macro as you see below:

PubMatic SpringServe