Cookie consent for Shopify: install Cookifi in under 10 minutes

Shopify's banner governs Shopify-managed tooling only, and its app pixels ignore any consent state that is not written into the Customer Privacy API. Cookifi writes into it, and runs GTM as a custom pixel so checkout is covered.

What you need

Any Shopify plan — you can edit the code of a theme you own. Checkout pages are not editable except on Plus through Checkout Extensibility, which is why GTM has to be a custom pixel.

Install Cookifi on Shopify

  1. 1

    Duplicate the theme, then open the code editor

    Shopify admin → Online Store → Themes → ⋯ → Duplicate as a backup, then ⋯ → Edit code.

  2. 2

    Add the script at the top of the head

    Under Layout open theme.liquid and paste the Cookifi integration script at the very top of <head>, above {{ content_for_header }}. Add defer if Shopify's editor prompts for it.

  3. 3

    Render the Customer Privacy API snippet

    Below {{ content_for_header }} add {% render 'cookifi' %}, then create Snippets → cookifi and paste the snippet from the Cookifi Shopify guide. It maps Cookifi's choices onto Shopify's setTrackingConsent.

  4. 4

    Remove Shopify's banner

    Settings → Customer privacy → Cookie banner → More actions → Remove cookie banner.

  5. 5

    Add GTM as a custom pixel

    GTM goes in Settings → Customer events → Add custom pixel, not in theme.liquid. The pixel is sandboxed and is the only way to fire on checkout and thank-you pages; the Consent Mode default and update commands belong inside it.

Get your Cookifi script

  1. 1.

    In the Cookifi admin click Add, enter a name and your domain — a sitemap URL is optional — and click Create.

  2. 2.

    Open the property and copy the script under General → Integration script.

  3. 3.

    Click the Google icon in the script toolbar to include the Consent Mode default command. The defaults themselves are set under Regions, together with URL Passthrough and Ads Data Redaction.

  4. 4.

    Paste it as high in the <head> as the platform allows, on every page. Save, reload, and confirm the banner appears.

  5. 5.

    If the platform strips data- attributes and the banner does not load, switch to Query string mode in the Installation script section and copy the script again.

  6. 6.

    Cannot touch the head at all? Use the GTM Installation script in a Custom HTML tag with the Consent Initialization – All Pages trigger. Direct installation is still the recommendation, because ad blockers can suppress GTM.

Consent Mode v2 and GTM on Shopify

On Shopify, consent lives in the Customer Privacy API (analytics, marketing, preferences, sale_of_data), and Shopify or app pixels ignore anything that is not written there — which is exactly what the snippet in step 3 does. GTM must run as a custom pixel: it is sandboxed with no DOM access, and it is the only way to fire on checkout and thank-you pages, so the Consent Mode default and update calls have to be pasted into the pixel itself.

What the native Shopify banner cannot do

Shopify cookie banner (Settings → Customer privacy)

  • It governs Shopify-managed tooling only — Shopify's own cookies and app pixels. Scripts pasted into theme.liquid are not blocked.
  • No per-vendor script blocking and no cookie scanning.
  • Enabled by default for the EEA and the UK only; every other region has to be added by hand.
  • No consent-log export in the admin.

Gotchas worth knowing

  • A theme update or reinstall drops theme.liquid edits — re-apply the script and the snippet afterwards.
  • Anything placed after {{ content_for_header }} loads after Shopify's own scripts and app pixels, which defeats the point.
  • The same tag in theme.liquid and in a custom pixel double-counts events.

The full Shopify guide

The Cookifi documentation carries a step-by-step guide for Shopify, including the snippets this page refers to.

What you get with Cookifi

Live in under 10 minutes

One script in the head, a scan that suggests the categories for you, and a 14-day trial that needs no card.

A flat base, not a tier ladder

One monthly base from €10 plus usage on read events — the first 10,000 each month are free. Subdomains and team members are unlimited, so a second site is not a second plan.

Support that answers

Live chat and email on every plan, with a human response within one business day on Enterprise. We are a small team, which is why the things customers ask for tend to ship quickly.

Built for the modern stack

Google and Microsoft Consent Mode v2 are first-class, GA4 and GTM are the default path, and Cookifi is a Google-certified CMP partner.

Frequently asked questions

Why is the Customer Privacy API snippet needed?

Because Shopify's own tooling and every app pixel read consent from that API and nothing else. Without the snippet, the banner would collect a choice that Shopify's pixels never see.

Is the banner shown on checkout?

Theme code does not run on checkout, so the banner itself does not appear there. What matters is that tags on checkout fire through the custom pixel, which respects the consent state Cookifi wrote into the Customer Privacy API.

Can I keep Shopify's banner as a fallback?

No — two banners mean two answers to the same question. Remove it under Settings → Customer privacy once Cookifi renders.

Try it on your own site

14 days, no credit card. If the install takes you longer than ten minutes, tell us — on our side that counts as a bug.