Consent Change Event

Silver Contributor
Silver Contributor

Hi,

is there an Event one could listen for, that is triggered every time the gdpr Object / Consent Setting is changed, i.e. every time utag.gdpr.setPreferencesValues or utag.gdpr.setConsentValue is called?

All the best,
Felix

2 REPLIES 2

Consent Change Event

Employee Emeritus

Hi @FelixHartmann 

We don't have any built-in functionality for that.

What you can try is to poll the cookie using setInterval. If you detect a change (or other reason) to the cookie clear the interval. eg:

var cookieChecker = setInterval(function(e) {
var mycookie = utag.loader.RC("mycookie");
if (mycookie == "false") {
// do something
clearInterval(cookieChecker);
}
}, 100);
 

Hope that helps!

Consent Change Event

Tealium Employee

@FelixHartmann This is a good idea. We could easily add a pub/sub feature, so that you can know when the cookie has been updated.

I would raise this in the product ideas.

Adrian

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.
Public