Tilbake til hjelpesenteret

Integrations

Shopify setup

Add the banner to your Shopify store

Sist oppdatert 15. november 2026

A complete guide to adding the GetCookies consent banner to your Shopify store, including standard themes, Shopify Plus, headless storefronts, and managing third-party apps.

Prerequisites

Before you begin, make sure you have:

  • A GetCookies account with a domain configured for your Shopify store URL (e.g., yourstore.myshopify.com or your custom domain).
  • Your Domain ID from the GetCookies dashboard (Domains > Widget Configuration).
  • Admin access to your Shopify store.

Install with theme code

There is no GetCookies app in the Shopify App Store yet, so you add the script to your theme.

Step 1: Open the Theme Editor

  1. In Shopify admin, go to Online Store > Themes.
  2. Click Actions > Edit code on your active theme.

Step 2: Add the Script to theme.liquid

  1. Open Layout/theme.liquid.
  2. Find the <head> tag.
  3. Add the following immediately after the opening <head> tag (before any other scripts):
html
<!-- GetCookies - Cookie Banner -->
<script src="https://app.getcookies.co/api/v1/widget/loader.js"
        data-domain-id="YOUR_DOMAIN_ID"></script>
  1. Click Save.
Important: Place the script as early as possible in the <head> to ensure blocking starts before other scripts load.

Step 3: Handle Checkout Pages (Shopify Plus Only)

Standard Shopify plans do not allow editing checkout pages. On Shopify Plus:

  1. Open Layout/checkout.liquid.
  2. Add the same script tag in the <head> section.
  3. Save.

For non-Plus stores, the checkout is hosted by Shopify and runs under their own cookie policies. The banner will cover your storefront pages but not the Shopify-hosted checkout.

Shopify Customer Privacy API

On a Shopify storefront the banner passes every choice to Shopify's Customer Privacy API with setTrackingConsent, mapped from your categories:

GetCookies categoryShopify consent
Analyticsanalytics
Marketingmarketing and sale_of_data
Preferencespreferences

Shopify's own tracking (Shopify analytics, Web Pixels from Settings > Customer events, and channel apps such as Google & YouTube or Facebook & Instagram) follows that consent, so they no longer run before the visitor agrees. On later page views the stored choice is written again only if Shopify holds a different one. Nothing needs to be configured: it works with the theme-code install above.

For headless storefronts, Shopify needs extra parameters (headlessStorefront, storefront and checkout domains and a Storefront API token) that the banner does not send; follow Shopify's Hydrogen consent guide there.

Managing Third-Party App Scripts

Many Shopify apps inject their own tracking scripts. Here is how to handle them:

Apps That Use GTM

If you use Google Tag Manager to manage your Shopify tracking:

  1. Install the GetCookies GTM template (see "GTM Template Installation Guide").
  2. Configure consent requirements on each tracking tag in GTM.
  3. This approach gives you the most control over third-party scripts.

Apps That Inject Scripts Directly

Some Shopify apps (e.g., review apps, upsell apps, tracking pixels) inject scripts directly into your theme. Known trackers among them (Meta, TikTok, Pinterest, Hotjar and others) are held back automatically; see Automatic tracker blocking. For the rest:

  1. Check if the app has a consent-mode or GDPR setting. Enable it if available.
  2. If the app injects scripts into theme.liquid, locate those script tags and add type="text/plain" and data-cookieconsent="marketing" (or the appropriate category):
html
<!-- Before: fires immediately -->
<script src="https://tracking-app.com/pixel.js"></script>

<!-- After: blocked until consent -->
<script src="https://tracking-app.com/pixel.js"
        type="text/plain"
        data-cookieconsent="marketing"></script>

Shopify's Built-in Analytics

Shopify's own analytics and pixels follow the consent GetCookies records through the Customer Privacy API (see above). GetCookies does not block Shopify's scripts itself.

Shopify Markets and Multi-Region Stores

If you sell in multiple countries using Shopify Markets:

  1. Leave Regulation Mode on Auto in your GetCookies dashboard. The banner then follows each shopper's location on every plan: opt-in consent in the EU, EEA and UK, an opt-out notice in the US. On Pro and above you can also show the banner only in the regions you sell in.
  2. Enable language auto-detection if your store supports multiple languages. GetCookies will show the banner in the visitor's language.
  3. Nothing else is needed for strict regions: under opt-in rules analytics and marketing stay blocked until the shopper agrees.

Headless Shopify / Hydrogen Storefronts

For headless Shopify setups using Hydrogen, the Storefront API, or a custom frontend:

  1. Use the direct script installation in your custom frontend's <head> section.
  2. For React/Hydrogen specifically, add the script tag to your root layout or index.html.
  3. See the "Custom HTML / Static Sites" or "Single-page apps and route changes" guides for SPA-specific considerations.

Verify the Installation

  1. Open your storefront in an incognito/private window.
  2. Confirm the consent banner appears immediately.
  3. Open DevTools > Network and verify that tracking scripts (Google Analytics, Meta Pixel, etc.) do not fire before consent.
  4. Click Accept All and confirm tracking scripts now load.
  5. Navigate to a product page and then the cart -- verify the banner state persists across pages.
  6. Check your GetCookies dashboard under Consent Logs to see the test consent recorded.

Troubleshooting

  • Check Domain ID: Verify it matches your Shopify store's domain exactly (including any custom domain).
  • Theme cache: Shopify caches theme assets aggressively. Wait a few minutes or try a hard refresh (Ctrl+Shift+R / Cmd+Shift+R).
  • App conflicts: If you have another cookie consent app installed, deactivate it first. Two consent banners will conflict.
  • Script placement: If using the manual method, ensure the script is inside the <head> tag and the syntax is correct.
  • Third-party apps: Some apps inject scripts that cannot be controlled via theme.liquid. Consider using GTM as a centralized script manager.
  • Inline scripts: Known trackers in Shopify sections or snippets are held back automatically. Wrap scripts GetCookies does not recognise with data-cookieconsent attributes.
  • Shopify Pixels: pixels under Settings > Customer events follow the Customer Privacy API. In each custom pixel, set Customer privacy to require the matching permission (Analytics or Marketing); a pixel set to "Not required" runs regardless of consent.
  • Use the Custom CSS option in your GetCookies dashboard to adjust positioning or z-index.
  • Common fix: .gc-banner { z-index: 999999 !important; }
  • If the banner overlaps a sticky header or cart drawer, adjust the banner position (e.g., switch from bottom bar to bottom-left popup).

Checkout page does not show the banner (non-Plus)

  • This is expected. Standard Shopify plans do not allow custom scripts on checkout pages. Consent given on the storefront persists via cookies, so users who consented before reaching checkout will retain their consent state.

Står du fortsatt fast?

Send e-post til [email protected] med domenet ditt og hva du har prøvd. Innloggede kunder kan også opprette en henvendelse fra dashbordet.