Programmatic API
Enable a vendor when the user has allowed it
window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function (Didomi) {
if (Didomi.isConsentRequired()) {
// Consent is required: your visitor is from the EU or you are an EU company
// Only enable the vendor when consent is given
Didomi.getObservableOnUserConsentStatusForVendor('vendor-id')
.filter(function(status) { return status === true; }) // Filter out updates where status is not true
.first() // Only get the first consent status update
.subscribe(function (consentStatusForVendor) {
// The user has given consent to the vendor
// Enable it
});
} else {
// Consent is not required, enable your vendor immediately
}
});Get notified when the consent status for a vendor changes
Last updated