How can I show the cookie banner to all users and automatically opt-in non-EU users?
AnsweredHi there,
We would like to implement the following policy using Cookiebot, but are currently running into a road block.
- If the user is in the EU, show the cookie banner and wait for the user to provide active consent to drop cookies.
- If the user is not in the EU, show the cookie banner but automatically opt-in the user to drop cookies.
Currently, we are able to accomplish #1 using Cookiebot. All EU users will be asked to consent before we can drop cookies in the user. I'm not sure how to facilitate #2 though. Right now, non-EU users will be opted in by default and they do not see the banner. We'd like to at least provide notice so they can be aware of our policy.
I was trying to use the JavaScript API to build a workaround by utilizing the Cookiebot_OnLoad callback, but have been unsuccessful so far. Here's the code I've been working with:
https://gist.github.com/jakebellacera/a3b179298f058d017449b364fc152ccb
If there is a way to use a different policy for EU and non-EU users within Cookiebot that I'm just not finding that would be ideal.
Thanks!
-
Hi Jake,
Regarding your point 2, you can either
1) display the banner and ask for consent also for non-EU users or
2) not display the banner to non-EU users.
The combination of displaying the banner (which is made and in place for obtaining a consent) and then not giving the user the option to submit their consent as they wish is not possible.
If you would like to notify the non-EU users about your cookie policy, you could perhaps implement a notice or pop-up of some kind on your website and then link to the Cookie Declaration (https://support.cookiebot.com/hc/en-us/articles/360004374474-What-is-the-Cookie-Declaration-cookie-policy-and-what-is-included-in-it-) or to elsewhere on your site where you describe your policy.
NOTE:
You can use a property on the Cookiebot object calledCookiebot.isOutsideEU
to detect the non-EU users and display a notice if you want.
Regards,
Elina
0 -
Hi Elina, can you show example how this property can be implemented and where do we inset this property?
Thanks!
0 -
Hi Hisham,
Bearing in mind that Cookiebot loads asynchronous, so the Cookiebot object may not be available at the time the function is called, here is a sample that you can look at:
<script>
function MyFunction() {
if (typeof Cookiebot !== "undefined") {
// pop up notice message here
} else {
setTimeout(MyFunction, 100);
}
}
</script>Regards,
Elina0
Please sign in to leave a comment.
Comments
3 comments