1. Implementing the Cookiebot consent dialog (cookie consent banner) in Magento:
1.1 In the Admin Panel, select System -> Configuration. Then in the panel on the left, under General, select Design → HTML Head.
1.2 Insert the Cookiebot consent dialog script into the Miscellaneous Scripts field:
<script
id="Cookiebot"
src="https://consent.cookiebot.com/uc.js"
data-cbid="00000000-0000-0000-0000-000000000000"
type="text/javascript"
async
></script>
Replace the zeroes with the CBID number from the domain group where the domain is added. It is available from the 'Your scripts' tab on your Cookiebot account.
1.3 When complete, click Save Config:
2. Implementing prior consent in Magento:
To enable prior consent (block cookies until user has consented), apply the attribute "data-cookieconsent" to all script tags setting cookies. Set the comma-separated value to one or more of the cookie categories "preferences", "statistics" and "marketing" in accordance with the types of cookies being set by each script. Finally change the attribute "type" from "text/javascript" to "text/plain". Scripts might be coming from the admin panel, theme files or extensions added to Magento.
In the Admin Panel: The most common places for scripts to be added are:
- System -> Configuration -> General -> Design -> HTML Head
- Static blocks
- CMS Pages
- Extension settings
Example on implementing prior consent:
2.1 On the Admin menu, select System -> Configuration. Then in the panel on the left, under General, select Design → HTML Head.
2.2 In the Miscellaneous Scripts field:
if you are using Google Analytics, make the following change to the code:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-00000000-0', 'auto');
ga('send', 'pageview');
</script>
Becomes (highlighted):
<script type="text/plain" data-cookieconsent="statistics">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-00000000-0', 'auto');
ga('send', 'pageview');
</script>
2.3 When complete, click Save Config:
3. Implementing the Cookie Declaration in Magento:
3.1 In the Admin Panel, select CMS → Pages. Then choose the page you want to show the Cookie Declaration on.
3.2 Into Content -> Show/Hide Editor, paste the Cookiebot Cookie Declaration script where you want it to appear on the page:
<script
id="CookieDeclaration"
src="https://consent.cookiebot.com/00000000-0000-0000-0000-000000000000/cd.js"
type="text/javascript"
async
></script>
Replace the zeroes with the CBID number from the domain group where the domain is added. It is available from the 'Your scripts' tab on your Cookiebot account.
3.3 When complete, click Save Page:
Comments
1 comment
If you want to have a convenient way how to install Cookiebot in your Magento store, you can also use our free extension:
Cookiebot Extension for Magento 1
Cookiebot Extension for Magento 2
Please sign in to leave a comment.