There are known cases where the Safari browser blocks Google Tag Manager. If you implement Cookiebot CMP via Google Tag Manager this could potentially cause tracking to occur without prior consent.
To avoid this you can create a fallback solution, which checks if the visitor is currently using the Safari browser. If this is indeed the case, the Cookiebot script will be added to the page via this script instead.
Here is the script in question:
<script>((d,s,c)=>{
if(!/^((?!chrome|android).)*safari/i.test(navigator.userAgent))return;
const e=d.createElement(s),r=d.getElementsByTagName(s)[0];e.id="Cookiebot";
e.type="text/javascript";e.src="https://consent.cookiebot.com/uc.js";e.dataset.
cbid=c;e.async=true;r.parentNode.insertBefore(e,r);})(document, "script",
"00000000-0000-0000-0000-000000000000")</script>
Remember to replace "00000000-0000-0000-0000-000000000000" in the above script with you own Domain Group id.
Comments
0 comments
Please sign in to leave a comment.