1. Help Center
  2. RevContent Native API

GDPR API Updates

We've made updates to our API and widget ad tags to support GDPR consent parameters. Our latest widget ad tags now support an optional data attribute data-gdpr and data-gdpr-consent that can be populated prior to loading our script. Our API and legacy widget ad tags support the optional parameters gdpr and gdpr_consent within the URL.

We now also support the usage of IAB's GDPR consent management provider API's for exchanging GDPR consent string. We currently support both API v1 and API v2 for consent exchange. Publishers supporting either v1 or v2 version of consent provider API and are required to expose either function __cmp or __tcfapi on their pages in order to return consent string. On our widget load, consent provider API is called with a timeout of 200ms. When no consent string is shared we assume no consent is given and only core functionality is applied. 

Additionally we support TCF 2.2 as part of GPP. RevContent's TCF vendor ID is 203.


API Widgets

Replace placeholders <GDPR> and <GDPR_CONSENT> with valid values


Standard Widgets (current format)

Add the attributes data-gdpr and data-gdpr-consent along with valid values for placeholders <GDPR> and <GDPR_CONSENT>

<script src="https://assets.revcontent.com/master/delivery.js" defer="defer"></script>

Standard Widgets (old/legacy format)

Replace placeholders <GDPR> and <GDPR_CONSENT> with valid values

<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 gdprConsent = "&gdpr=<GDPR>&gdpr_consent=<GDPR_CONSENT>";
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 + gdprConsent;
rcel.async = true;
var rcds = document.getElementById("rcjsload_2ff711");


Additional Relevant Articles

IAB GDPR Compliance Guide
Consent Management Provider JavaScript API v1.1
Consent Management Platform JavaScript API v2