CookiebotCallback_OnLoad not firing on initial cookie banner load
AnsweredHi Cookiebot Community,
I am looking into using Cookiebot as a GDPR compliance solution, but have run into an issue when trying to implement a particular use case as follows:
1. I have the following script being included as a tag in GTM:
function CookiebotCallback_OnLoad() {
console.log("cookiebot on_load callback");
if (Cookiebot.isOutsideEU) {
// fire off some custom GTM events
}
}
2. I navigate to my website and the Cookiebot banner loads for the first time.
* Note that at this point I have yet to interact with the banner in any way or provide any consent.
3. I'm expecting the "CookiebotCallback_OnLoad" function to have been fired and to see my console log and when my IP is outside the EU region to have some custom logic with GTM to fire.
The problem is that it doesn't appear that the "CookiebotCallback_OnLoad" callback is being triggered at all on this initial load before I've interacted with the banner at all.
One I've provided consent once and submitted the banner form and load my site again (the banner does not appear anymore since I've already provided my consent) I can see the "on_load" firing.
I've also tried using the "CookiebotCallback_OnAccept" callback am also experiencing some odd behaviour as it does not fire when I've hit "OK" and submitted my consent.
This does not seem like the intended behavior of these callbacks given their descriptions on the Developer page. Is this a bug or is there perhaps a configuration I am missing?
Thanks!
-
Hey Sisi Guo,
We have two new callbacks for the banner, which is not yet documented in our help section, apologize for that. It will be updated soon.
1. CookiebotCallback_OnDialogInit: Triggers before the banner is initialized/constructed. Can be used to change content attributes on the Cookiebot.dialog object before the DOM object is constructed.
2. CookiebotCallback_OnDialogDisplay: Triggers when the banner is displayed to the visitor.
Regards, Martin0 -
Hi Martin,
Okay, yes everything works now with those new callbacks.
Thank you!
0
Please sign in to leave a comment.
Comments
2 comments