1. Implementing the Cookiebot consent dialog (cookie consent banner) in Shopify:
1. In the Admin panel you need to be on the Home tab and then click Customize theme:
2. Then click on Customize and you will open the theme control or if you have added new themes, then click on the Customize button for the corresponding theme:
3. On the bottom left go to Theme actions and click Edit code to open your HTML Editor:
4. Add the cookiebot script in the <head> of the page. See also step 1 and 2 in the general 3-step implementation guide for how to get the script.
<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:
2. Implementing prior consent on Shopify:
To enable prior consent (block cookies until the user has consented), apply the attribute "data-cookieconsent" to all script tags setting cookies. Set the comma-separated value of the attribute to one or more of the three types of cookies: "preferences", "statistics" and "marketing" in accordance with the types of cookies being set by each script. Finally change the script tag attribute "type" from "text/javascript" to "text/plain".
If you are using traditional Google Analytics, make the following change to the code:
$javascript .= "<script type=\"text/javascript\">
becomes:$javascript .= "<script type=\"text/plain\" data-cookieconsent=\"statistics"\>
If you are using Google Analytics Universal, 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');
becomes (highlighted in bold):
<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');
3. Implementing the Cookie Declaration in Shopify:
To show the Cookie Declaration on your website (in a new page or e.g. as part of your existing privacy policy), do the following:
1. Go to the tab Pages on the left-hand side menu of the admin panel and click Add page:
2. Add the script for the Cookie Declaration in the content area with html editor enabled and click the button Save (bottom right).
<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
Last updated: 22 June 2018
Comments
1 comment
Don't forget about cookies that your javascript might be setting on checkout completion pages. These pages are not part of your theme, so you'll need to add Cookiebot to the "Additional scripts" section of the checkout settings in Shopify.
Please sign in to leave a comment.