Cookie compliance integration for Shopify
Cookie compliance integration for Shopify
There are three ways to install CookieScript on Shopify:
By using a Shopify app
By modifying a template file on Shopify
By using the Google Tag Manager (GTM) Tag template.
We recommend to use the Shopify app or GTM for installation since it will be easier to update CookieScript later and it's easier to enable Google Consent Mode.
Note: If some method is not working for you- use a different one. Use only one method to install CookieScript. If you switch from one method to another- remove the previous script.
Method 1: Installing CookieScript via Shopify app
To make the CookieScript snippet installation easier and more enjoyable, we have created the Shopify app. To install CookieScript, simply follow instructions:
Go to your Shopify account.
Find the tab Apps, and press Add apps:
After you get the window as shown in the figure below, press Shopify App Store:
Go to the Search field, type Cookiescript, and tap on the CookieScrip app:
Press Install:
The CookieScript app will be added to your Shopify account. At your Shopify dashboard, press Install again:
To finish the CookieScript installation process, you need the CookieScript cookie banner code. Go to your CookieScript account > Settings > Install:
Press Shopify, and copy the CookieScript code.
Return to your Shopify dashboard, paste the CookieScript source URL, and press Add:
Enable Google Consent Mode v2 by checking the checkbox:
Once enabled, you can control the settings of Google Consent Mode separately.
All done, CookieScript app is installed on Shopify now and is ready for use.
Method 2: Installing CookieScript on Shopify by editing theme files.
There is no way to include an external script to Shopify in the checkout, all you can to do is to include the CookieScript code on your Storefront and the Order Confirmation page. Perform the following steps:
Go to your CookieScript account > Settings > Installation.
Press the Shopify tab and copy your CookieScript code.
Log in to your Shopify Dashboard.
Tap on Online Store, then Themes.
Tap on the Actions button and choose Edit HTML/CSS.
Under layout, select theme.liquid:
Paste the copied CookieScript snippet just before the </body> closing tag.
Click Save.
Note: Depending on the theme, the closing tag in the step 8 could be {/head}, [/header], or other variations of [/head].
CookieScript is installed on Shopify now and is ready for use.
Note: If the banner doesn’t appear after the implementation, check if you don’t use any Cache plugin or extension, which prevents the banner from popping-up.
Common problems: If you have issues with the Cart, add the following cookies to CookieScript cookie declaration as strictly necessary cookies:
Method 3: Installing CookieScript using the GTM Tag Template
Read this guide on how to install CookieScript on Shopify using the GTM Tag template.
This method allows you to implement Google Consent Mode on your website easily.
Did this answer your question?