Info
Content

Passing the Consent String to a vendor

The IAB TCF specification is designed in a way so that vendors can automatically fetch the consent information from the CMP using the IAB TCF JS API. In case a vendor can not fetch the string (e.g. because only an <img> is implemented and not a <script> or <iframe>) you can use the following example script to fetch the relevant data:

<script>
  var tcstring = "";
  __tcfapi('getTCData',2, function (x,s){
    if("tcString" in x)
    {
      tcstring = x.tcString;
    }
  });  
  
  document.write('<scr'+'ipt src="https://www.adserver.de/banner?gdpr_consent=' + tcstring +'&gdpr=1"></sc'+'ript>');
</script>

 

Back to top