dataLayer pushes working inconsistently
CompletedHi all,
I am experiencing unusual behavior for the dataLayer pushes indicating the user's consent. On some devices/browsers the dataLayer pushes are coming in as desired on others no dataLayer pushes occur at all.
The implementation followed this guideline exactly:
Any ideas what might cause this?
-
Same problem here, I've sent a ticket regarding this, the dev team is looking into this.
0 -
Hi Oleg,
Cookiebot support came back to me with the following instructions for a workaround:
It appears a recent release resulted in events not getting pushed to the dataLayer anymore when using auto blocking and Google Tag Manager.
Our developers have been notified and are working on a solution.
As a temporary work around, you can use this script to manually push events to the dataLayer is consent has been given:<script>
(function () {
var CookiebotEventsPushed = false;
for (i = 0; i < dataLayer.length; i++) { if ( dataLayer[i].event == "cookie_consent_preferences" ||
dataLayer[i].event == "cookie_consent_statistics" ||
dataLayer[i].event == "cookie_consent_marketing")
CookiebotEventsPushed = true;
} if (!CookiebotEventsPushed && Cookiebot.consented) {
Cookiebot.consent.preferences && dataLayer.push({ event: "cookie_consent_preferences" });
Cookiebot.consent.statistics && dataLayer.push({ event: "cookie_consent_statistics" });
Cookiebot.consent.marketing && dataLayer.push({ event: "cookie_consent_marketing" });
}
})();
</script>0
Post is closed for comments.
Comments
2 comments