CCPA with OpenRTB

Real-time Bidding (RTB) is a way transacting media that allows a singular ad impression to be bid on in real-time.

The International Advertising Bureau (IAB) has advised modifications to the RTB BidRequest object to allow “us_privacy” be embedded to the current BidRequest object. Through this extension, publishers can pass along the required consent strings, and downstream actors can validate and include the information into their automated RTB decisions. First, you will need to get the users current "us_privacy" string, which can be handled through a number of methods:

function getUsPrivacyStr() {
// Format cookies into array-like key value pairs
var cookies = document.cookie.split('; ').map(cookie => cookie.split('='));
// Store U.S. Privacy string
let usPrivacyString = cookies.find(cookie => cookie[0] === 'usprivacy')[1] || '';
return usPrivacyString;
}
let usPrivacy = getUsPrivacyStr();
if (usPrivacy !== '') {
... Use as necessary ...
console.log('US Privacy String: ', usPrivacy);
}

To modify your Bid Request Object, follow along below:

OpenRTB v2.0 - 2.1

Modify the "ext" object, which can be found in the BidRequest "user" object.

{
"user": {
"ext": {
"us_privacy": "1---"
}
}
}
// Or programatically:
BidRequest.user.ext.us_privacy = "1---";

OpenRTB v2.2+

Modify the "ext" object, which can be found in the BidRequest "regs" object.

{
"regs": {
"ext": {
"us_privacy": "1---"
}
}
}
// Or programatically:
BidRequest.regs.ext.us_privacy = "1---";

For more information on CCPA and OpenRTB, the IAB provides further documentation on extending the BidRequest object, which can be found here.

We recommend changes to the OpenRTB BidRequest object be validated prior to deployment with a Real-Time Bid Request Validator.