Cookie compliance integration for Shopify

Cookie compliance integration for Shopify

Nelson
Written by NelsonLast update 4 months ago

There are two ways of installing CookieScript on Shopify: with a Shopify app or by modifying template file. We recommend to use the Shopify app since it will be easier to update CookieScript later and it's easier to enable Google Consent Mode.

Alert: In August 2024, the Shopify app support is unclear. To ensure continued functionality, we recommend using Google Tag manager (GTM) where possible.

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:

  1. Go to your Shopify account.

  2. Find the tab Apps, and press Add apps:

  3. After you get the window as shown in the figure below, press Shopify App Store:

  4. Go to the Search field, type Cookiescript, and tap on the CookieScrip app:

  5. Press Install:

  6. The CookieScript app will be added to your Shopify account. At your Shopify dashboard, press Install again:

  7. To finish the CookieScript installation process, you need the CookieScript cookie banner code. Go to your CookieScript account > Settings > Install:

  8. Configure geo-targeting.

  9. Press Shopify, and copy the CookieScript code.

  10. Return to your Shopify dashboard, paste the CookieScript source URL, and press Add:

  11. 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:

  1. Go to your CookieScript account > Settings > Installation.

  2. Configure geo-targeting.

  3. Press the Shopify tab and copy your CookieScript code.

  4. Log in to your Shopify Dashboard.

  5. Tap on Online Store, then Themes.

  6. Tap on the Actions button and choose Edit HTML/CSS.

  7. Under layout, select theme.liquid:

  8. Paste the copied CookieScript snippet just before the </body> closing tag.

  9. 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:

Did this answer your question?