Consent Change Event

FelixHartmann
Bronze Contributor
Bronze Contributor FelixHartmann

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
Highlighted

Consent Change Event

Tealium Employee

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 Javascript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.