Spotx: Passing Contextual Data

This details how to format the iris_context and iris_id KVPs in the SpotX tag and OpenRTB integrations.

Tag Integration

The tag integration leverages the custom key-value pair formatting to pass in the iris_context and iris_id KVP.  Here's the documentation from SpotX on how to format custom KVPs in the ad tag: https://developer.spotxchange.com/content/local/docs/publisher-resources/kvps.md#key-value-pairs-and-reporting.

This is how  "iris_context" should be formatted as a custom key-value pair:

&custom[iris_context][]=ic_0755895,ic_4890138,ic_4980180&

To pass the "iris_id" publishers can do one of two updates:
1. pass &content[id][]=
(which is the ORTB supported content field and does not need to be mapped to anything. we will simply pass it through)

&content[id][]=iris_18719437&

OR
2. pass &custom[iris_id}[]=
(which is a KVP that SpotX will be able to map to content[id] in order to pass it in the bid response.)

&custom[iris_id}[]=iris_18719437&

OpenRTB Integration

The OpenRTB integration leverages the custom KVP object to pass in the iris_context and iris_id KVPs. Here's the documentation from SpotX on how to format custom KVPs in OpenRTB: https://developer.spotxchange.com/content/local/docs/publisher-resources/ortb-2.3-integration.md#video-ext-custom.

This is how "iris_context" and "iris_id" should be formatted in the custom object for the OpenRTB request:

{
custom : {
"iris_context" : [
"ic_0755895",
"ic_4890138"
],
"iris_id" : "iris_18719437"
}
}

Prebid.org Integration

The Prebid.org integration leverages the custom KVP object to pass in the iris_context and iris_id KVPs. Here's the documentation from SpotX on how to format custom KVPs in Prebid.org:

https://developer.spotxchange.com/content/local/docs/HeaderBidding/PrebidAdapter.md#passing-key-value-pairs

var adUnits = [{
    code: 'uniqueId',
   mediaTypes: {
       video: {
            context: 'instream',
           playerSize: [300, 250]
       }
   },
   bids: [{
        bidder: 'spotx',
       params: {
            channel_id: 85394,
            ad_unit: 'instream',
            // ###### KVPS CAN GO HERE #######
           custom: {
               iris_id: iris_18719437,
               iris_context: [
                 ‘ic_0755895’,
                 ‘ic_4890138’,
              ]
           }
           // ###############################
       }
   }]
}];