[ SHOPIFY ]
Shopify cookie consent banner: setup guide
Short answer: you can add a CookieJar cookie consent banner to a Shopify store with one script tag placed before </head> in your theme.liquid file. The banner adapts to the visitor's location and records each choice with a timestamp. Today CookieJar does not pass visitor choices to Shopify's Customer Privacy API, so it does not control Shopify-managed surfaces such as Shopify's pixels, audiences or checkout. For those, Shopify's own consent settings apply.
Install on Shopify
Open theme.liquid
In your Shopify admin, open the code editor for your live theme and find the theme.liquid file.
Paste the tag before </head>
Copy your CookieJar script tag from the dashboard and paste it just before the closing </head> tag, then save.
Check your storefront
Open your store in a private window and confirm the banner appears and that your choice is recorded in the CookieJar dashboard.
How Shopify handles visitor consent
Shopify has its own consent system for its storefronts, called the Customer Privacy API. Every point below comes from the Shopify Customer Privacy API docs.
- The Customer Privacy API is a browser JavaScript API that manages visitor consent for data processing on Shopify storefronts. Shopify Customer Privacy API docs
- Third-party consent banners should load the API, collect the visitor's choices in their own interface, and call setTrackingConsent() with those choices. Shopify Customer Privacy API docs
- Consent must be recorded only when the visitor interacts, such as accepting or declining in a banner, and never automatically on the visitor's behalf. Shopify Customer Privacy API docs
- The API applies consent decisions to Shopify-managed surfaces such as pixels, audiences and checkout. Shopify Customer Privacy API docs
- In regions the merchant configures as requiring consent, non-essential purposes are not allowed by default until consent is given. In other regions the default is to allow all purposes. Shopify Customer Privacy API docs
- Custom storefronts pass extra domain and token parameters so consent carries through to checkout. Shopify Customer Privacy API docs
How CookieJar works on Shopify
CookieJar runs on your storefront pages as a regular script. Here is what it does today, and what it does not do.
- Installs with one script tag in your theme, placed before </head> in theme.liquid.
- Geo-aware banner choices: the banner shown depends on where the visitor is browsing from.
- Consent receipts with a timestamp: each accept, reject or saved choice is recorded with the categories chosen and the time.
- What it does not do: CookieJar does not currently call setTrackingConsent(). That means a visitor's choice in the CookieJar banner is not passed to Shopify, and CookieJar makes no claim about how Shopify's own pixels, audiences or checkout behave. Those follow Shopify's consent settings and defaults described above.
Step-by-step setup
1. Create a CookieJar account and add your store's domain. 2. Run a scan so CookieJar can list the scripts your storefront loads. 3. Review the categories and your banner text. 4. In Shopify, open your live theme's code and edit theme.liquid. 5. Paste the CookieJar script tag just before </head> and save. 6. Visit your store in a private window and confirm the banner appears. 7. Make a choice and check that it shows up in your CookieJar consent records with a timestamp. 8. Separately, review your consent settings in Shopify, including the regions you have set as requiring consent, because these control Shopify-managed surfaces.
Common mistakes
Each of these follows from Shopify's documentation and from what CookieJar does today.
- Assuming the CookieJar banner controls Shopify's pixels, audiences or checkout. Shopify applies consent to those surfaces through its Customer Privacy API, which CookieJar does not currently call.
- Recording consent automatically for visitors. Shopify's documentation says consent must be recorded only when the visitor interacts, never on their behalf.
- Forgetting Shopify's regional defaults. Outside the regions you configure as requiring consent, Shopify's default is to allow all purposes.
- On a custom storefront, leaving out the extra domain and token parameters, so consent does not carry through to checkout.
- Pasting the tag somewhere other than before </head> in theme.liquid.
Before you rely on it
Running two consent systems side by side is common on Shopify, so be clear about which one controls what. The CookieJar banner and its consent records cover the scripts CookieJar manages on your storefront pages. Shopify's Customer Privacy API covers the surfaces Shopify manages. Check both, test them from the regions you sell to, and keep your Shopify region settings in line with your banner. CookieJar is software, not legal advice.
[ FAQ ]
Shopify questions
Last reviewed: 10.03.2026 by CookieJar team.
Ready to add it to your Shopify site?
Free tier covers 5,000 pageviews on 1 domain — no credit card required.