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://site.staging.consentmanager.net/help/developer-reference/cmp-events/ 

We do our best to keep this purely informative documentation up to date. However, if you notice that any of these guides need a little touch-up, let us know!