consent.get
Method to receive TrustCommander consent and consent metadata OnSite via JavaScript.
cact('consent.get', function (result) { ... });Examples
Executing code based on the consent setting of a category
cact('consent.get', function (result) {
const ANALYTICS_ID = 2;
const analyticsCategory = result.consent.categories[ANALYTICS_ID] || {};
if (analyticsCategory.status === 'on') {
// Consent was provided for the category.
} else {
// Consent was not provided for the category.
}
});Executing code based on the consent setting of a category and vendor
Check if consent was already set by the visitor
Checking when the current consent expires
Last updated