1. Help Center
  2. Revcontent Native API

CCPA API Updates

We've made updates to our API and widget ad tags to support CCPA consent parameters. Our latest widget ad tags now supports an optional data attribute data-us-privacy which can be populated prior to loading our script. Our API and legacy widget ad tags support the optional parameter us-privacy within the URL.

Additionally, we now support the usage of IAB's US Privacy User Signal API for exchanging CCPA consent string. Publishers are required to expose function __uspapi on their pages in order to return consent string. On widget load user signal API is called with a timeout of 200ms.

API Widgets:

Replace placeholder <CCPA_STRING> with valid consent string

http://trends.revcontent.com/api/v1/?api_key=&pub_id=&widget_id=&domain=&format=json&sponsored_count=25&us_privacy=<CCPA_STRING>

Standard Widgets (current format):

Add the attribute data-us-privacy along with a valid CCPA String as the value 

<div
data-rc-widget
data-endpoint="trends.revcontent.com"
data-us-privacy="<CCPA_STRING>">
</div>
<script src="https://assets.revcontent.com/master/delivery.js" defer="defer"></script>

Standard Widgets (old/legacy format):

Replace placeholder <CCPA_STRING> with valid consent string

<div id="rcjsload_2ff711"></div>
<script type="text/javascript">
(function() {
var rcel = document.createElement("script");
var referer = "";
try {
if (referer = document.referrer, "undefined" == typeof referer) throw "undefined"
} catch (exception) {
referer = document.location.href, ("" == referer || "undefined" == typeof referer) && (referer = document.URL)
}
referer = referer.substr(0, 700);
var usPrivacy = "&us_privacy=<CCPA_STRING>";
rcel.id = 'rc_' + Math.floor(Math.random() * 1000);
rcel.type = 'text/javascript';
rcel.src = "//trends.revcontent.com/serve.js.php?uitm=1&w=<WIDGET_ID>&t=" + rcel.id + "&c=" + (new Date()).getTime() + "&width=" + (window.outerWidth || document.documentElement.clientWidth) + "&referer=" + referer + usPrivacy;
rcel.async = true;
var rcds = document.getElementById("rcjsload_2ff711");
rcds.appendChild(rcel);
})();
</script>


IAB CCPA Compliance Guide

IAB CCPA String