Open BKKNomad opened 3 months ago
Hello,
Do you have any answers to my previous request? Would it be possible to send a dataLayer event cookie_consent_update every time consent is updated?
Many thanks in advance for your help and best regards
Hi,
It should be possible to achieve this behavior by attaching custom event handlers to the consent:first-action
and consent:changed
events.
<script>
function onConsentUpdated() {
window.dataLayer.push({
'event': 'some_consent_changed',
});
}
window.cookieConsentWrapperEvents = window.cookieConsentWrapperEvents || [];
window.cookieConsentWrapperEvents.push(['consent:first-action', onConsentUpdated]);
window.cookieConsentWrapperEvents.push(['consent:changed', onConsentUpdated]);
</script>
Hello Guys,
I'm figuring out an issue with your cookie consent solution, which is great in the meantime.
There are many dataLayer events like this when the cookie consent is updated (one event per type of cookie):
However, there is no final cookie_consent_update event that would allow us to trigger tags anytime the cookie consent is updated (a uniform event that triggers regardless of the type of cookie).
Currently, I cannot trigger tags based on the existing detailed events as these tags will trigger too many times. Would it be possible to send a final event anytime the cookie consent is updated?
Many thanks for your help and best regards