Installation: Shopify cookie banner

Have more questions? Submit a request

How to install the CookieFirst banner on a Shopify website? Follow this guide. 


Are you a Shopify Merchant? You can now install our Shopify Embedded App through the app store. Click here to read more. !important: Existing customers cannot be migrated to the Shopify App. You will first need to delete your account on the CookieFirst platform. 




If you are using the Shopify GDPR settings under preferences please use the following guide to connect the banner to the Shopify API to manage tracking under the GDPR. See this article for a helper script.

1. Manually add the cookie banner to your Shopify website

Login to your Shopify website and go to Themes . Select Edit code.


Open the file called theme.liquid and look for a line that starts with <body In my example below this is called

<body class="template-{{ request.page_type | handle }}">


Directly below that line you need to copy your embed script you can find under your domain settings. Something like this:

<script src="<API Key>/consent.js"></script>

Past the embed code before the closing </head> tag in your code. 

2. Enable Shopify Customer Privacy API

To make the banner communicate with the Shopify customer privacy api you will need to add another script under the Cookie banner embed code see the code below. More about the api can be found in the documentation on the Shopify website.

<!-- CookieFirst Shopify privacy API -->
<script src="" defer></script>


Reload your website, and the banner should be visible

3. Make sure to enable the shopify privacy api in the privacy settings.

Follow the steps in the following article. Shopify App: Enable privacy settings and cookie banner regions

It's currently not possible to add the banner on your checkout process. It's only supported to add scripts there if you're on the Shopify Plus plan.

Articles in this section

Was this article helpful?
5 out of 9 found this helpful