Info
Content

Checking Consent for a Vendor

In order to check if a certain vendor has consent, we recomment do use the global __cmp function and call command getCMPData:

var x = __cmp('getCMPData');
if("vendorConsents" in x)
{
 if("s123" in x.vendorConsents && x.vendorConsents["s123"])
 {
  // Vendor s123 has consent
 }
 else
 {
  // Vendor s123 does not have consent
 }
}

For the example above, please be aware that you call our __cmp() object only when it is already loaded. In case of doubt please use a callback in our events (e.g. "consent" or "settings" event):
https://help.consentmanager.net/books/cmp/page/cmp-events 

Back to top