consent.onReady
Method to obtain Commanders Act consent when it becomes available.
cact('consent.onReady', function (result) { ... })Example
Example to wait for consent availability and do something on a specific category
cact('consent.onReady', function (result) {
var ANALYTICS_ID = 2;
var analyticsCategory = result.consent.categories[ANALYTICS_ID] || {};
if (analyticsCategory.status === 'on') {
// Consent was provided for the category.
} else {
// Consent was not provided for the category.
}
});
Last updated
Was this helpful?