DEVELOPER GUIDES

Cookie consent for Shopify

The code goes into theme.liquid, as high in <head> as possible — above Shopify’s own scripts and above apps.

layout/theme.liquid
<head> <meta charset="utf-8"> <script id="CookieFood" src="https://cookiefood.b-cdn.net/v1/consent.js" data-cfid="YOUR-ID" data-blockingmode="auto"></script> {{ content_for_header }} ... </head>

What to watch out for

Above content_for_header

That is where Shopify injects its own scripts and apps — you need to be earlier.

App Store apps

CookieFood holds most of them back automatically. If one slips through, report it and we add a rule.

Duplicate banner

If Shopify’s own cookie banner is enabled, turn it off — otherwise they overlap.

Where to get your YOUR-ID

Sign up, add a domain and you get the ID right away — the scan starts by itself. The snippet never changes again; everything else is configured in your account.

Other environments