---
title: "Shopify Cookie Banner for UK GDPR (2026 Setup)"
description: "Shopify cookie banner for UK GDPR and PECR: opt-in for UK shoppers, Customer Privacy API bridge, theme pixels, checkout behaviour, and how to test it."
url: "https://cookiebeam.com/guides/shopify-cookie-banner-uk-gdpr-2026"
lang: "en"
last_updated: "2026-11-16T10:49:30.860Z"
---

# Shopify Cookie Banner for UK GDPR and PECR: 2026 Setup

UK shoppers need an opt-in banner, and Shopify's own tracking has to hear their answer. Here's how CookieBeam relays UK consent choices to Shopify's Customer Privacy API, and what else still needs gating.

UK cookie law is built on two statutes that operate in tandem. **PECR** regulation 6 prohibits storing or reading information on a visitor's device without consent, unless the storage serves a strictly necessary purpose. The **UK GDPR** then sets the bar for what consent has to look like: freely given, specific, informed, and delivered through an unambiguous affirmative action, with withdrawal made no harder than the original agreement. For UK visitors, the upshot is an opt-in banner, a reject button given equal prominence to accept, and every analytics or advertising tag held back until the visitor actively agrees.

A Shopify store splits the consent problem in two. On one side are the scripts you install yourself; on the other is Shopify's own platform. Shopify analytics and any app that reads consent through the Customer Privacy API decides what data to collect based on the consent state that API reports. An opt-in banner that doesn't relay the visitor's answer to Shopify leaves a gap. CookieBeam closes it with a consent bridge, and the CookieBeam app embed ensures the API loads early enough that the visitor's answer isn't missed.

> **Tip: TL;DR**
>
> PECR applies to every site that writes to or reads from a UK visitor's device, whatever the size of the business. Strictly necessary storage is exempt. The Data (Use and Access) Act 2025 added exceptions for certain analytics, visual-preference and security cookies, on the condition that you provide clear information and a straightforward objection mechanism. Advertising and cross-site tracking still demand prior opt-in consent.

**Requirements under UK GDPR and PECR**

| Requirement | What the law expects |
| --- | --- |
| Consent before non-essential storage | PECR regulation 6 demands consent before storing or reading data on a device, unless the storage is strictly necessary or qualifies for one of the statutory exceptions |
| What counts as consent | The UK GDPR requires a clear affirmative act that is both specific and informed. Pre-ticked boxes and consent inferred from continued browsing do not meet the standard |
| Rejecting | The ICO expects a reject option for non-essential cookies that is equally visible and easy to reach as the accept option, displayed on the same layer of the banner |
| Withdrawing | Visitors must be able to withdraw consent whenever they wish, and the withdrawal process cannot be harder than the original consent was |
| Statutory exceptions | The Data (Use and Access) Act 2025 introduced exceptions for certain analytics, visual-preference and security cookies, provided you give clear information and offer a simple objection mechanism. No exception covers advertising cookies |

## How CookieBeam's UK GDPR preset handles it

CookieBeam provides a regional preset designed for UK visitors. Applying it generates an editable rule that ships with the following starting values.

**What the UK GDPR preset sets**

| Setting | CookieBeam preset |
| --- | --- |
| Who it matches | Visitors in the United Kingdom |
| Banner mode | Opt-in: analytics and advertising stay off until the visitor accepts |
| Buttons | "Accept all cookies" and "Reject non-essential cookies" on the first layer, with equal weight, plus "Cookie settings" |
| Google Consent Mode defaults | ad_personalization, ad_storage, ad_user_data, analytics_storage and personalization_storage start denied |
| Global Privacy Control | Not acted on unless you turn on privacy signals; when on, it pre-selects deny and an explicit opt-in still wins |
| Stored choice | Expires after 182 days, then the visitor is asked again |

## Where Shopify sites leak data

- **Shopify's own tracking.** Shopify analytics and apps that check consent via the Customer Privacy API only learn a visitor's choice when something passes it along. CookieBeam's Shopify bridge calls `setTrackingConsent` whenever the API is available on the page, sending analytics, marketing, preferences and `sale_of_data`. The app embed also loads the API so it is available earlier.
- **Pixels added in theme code or by apps.** A tracking pixel dropped straight into `theme.liquid` runs at page render unless you mark it as inert so CookieBeam can activate it later. Pixels that come from installed apps need individual verification.
- **Checkout.** Theme code and theme app embeds don't run on checkout pages, which means the banner won't show there. The choice the shopper made on the storefront is stored by the Customer Privacy API and carries through to checkout.

## What Shopify receives for a UK shopper

With the UK GDPR preset active, analytics and advertising start in the denied state. CookieBeam passes that state to Shopify through `setTrackingConsent`, mapping `analytics` from the analytics choice, `marketing` from the advertising choice, and `sale_of_data` from the ad-user-data signal. `preferences` follows personalisation and functionality storage, so it grants when either of those categories is accepted.

If you install through theme code rather than the app embed, the bridge can only reach Shopify when the Customer Privacy API is already loaded on the page. Check with `currentVisitorConsent()` before depending on it.

## Set up CookieBeam on Shopify for UK GDPR and PECR

### Step 1: Publish your banner first

Build the banner in CookieBeam, set up its consent categories, and publish it to production so the loader script has a live configuration to serve. See the [quickstart](https://cookiebeam.com/docs/getting-started/quickstart).

### Step 2: Add the store's domains to the banner

In CookieBeam, add both the `*.myshopify.com` domain and any custom domain to the banner.

### Step 3: Load the banner on every storefront page

Using the CookieBeam app: navigate to **Online Store &rsaquo; Themes &rsaquo; Customize &rsaquo; App embeds**, enable **CookieBeam consent banner**, enter the banner ID and save. The app isn't in the Shopify App Store yet. Without it, paste the production loader as the first script in `<head>` of `layout/theme.liquid`. Do not add `async` or `defer`.

### Step 4: Turn off Shopify's own cookie banner

In Shopify admin, go to **Settings &rsaquo; Customer privacy** and disable the built-in banner so visitors see a single prompt instead of two competing ones.

### Step 5: Apply the UK GDPR preset

On the banner's **Regional settings** page, add a rule from the **UK GDPR** framework preset. It matches visitors in the United Kingdom with an opt-in banner: analytics and advertising stay off until the visitor accepts. Add the GDPR (EU/EEA) preset too if you also serve EU visitors. See [regional rules](https://cookiebeam.com/docs/configure/regional-rules).

### Step 6: Put every tag in a category

Assign analytics tags to the analytics category and advertising pixels to marketing. Scripts that appear in your reviewed scan inventory are managed by CookieBeam once you turn on blocking; scripts hard-coded in the page need inert markup (`type="text/plain"` with a `data-category` attribute) so CookieBeam can control them. See [script blocking](https://cookiebeam.com/docs/configure/blocking). In opt-in mode, those scripts stay inert until the visitor accepts the relevant category.

### Step 7: Save, publish and test

Click **Save Settings**, then **Publish** in the banner header. Changes to rules only take effect for visitors after you publish. Full install instructions: [Shopify install docs](https://cookiebeam.com/docs/integrations/shopify).

`layout/theme.liquid`

```html
<!-- layout/theme.liquid: first script in <head> -->
<script
  id="CookieBeam"
  src="https://cdn.cookiebeam.com/banner/PUBLIC_BANNER_ID/default/loader.js"
  type="text/javascript"
  data-cfasync="false" data-no-optimize="1" data-no-defer="1"
  data-no-minify="1" data-noptimize="1" nowprocket data-pagespeed-no-defer
></script>
```

> **Warning: What the ICO looks for**
>
> The ICO's cookie enforcement actions have consistently targeted two failures: banners that make rejecting harder than accepting, and non-essential cookies that load before the visitor has chosen. A banner that looks right but still sends an advertising request on the first page view fails that second test. The Data (Use and Access) Act 2025 also brought the maximum penalty under PECR up to the UK GDPR level. Check what actually loads in the browser, not just what the banner displays.

## Test your Shopify store like a UK visitor

1. Open the site in a fresh browser profile from the UK, or with a geo-simulated preview, and confirm the opt-in banner appears with both reject and accept buttons on the first layer.
2. Before making any choice, open the Network tab: no analytics or advertising requests should have gone out.
3. Click reject, reload the page, and verify those requests still haven't appeared.
4. Reopen the cookie preferences, accept analytics only, and check that only analytics tags activate.
5. Run `window.Shopify.customerPrivacy.currentVisitorConsent()` in the browser console after each consent choice and confirm that the returned flags match what you selected.

The [cookie banner QA checklist](https://cookiebeam.com/guides/test-cookie-banner-compliant-qa-checklist-2026) walks through additional checks.

> **Tip: Scan your Shopify store free**
>
> Before you make any changes, find out what your Shopify store loads today. CookieBeam's Free plan includes 1 cookie scan a month with no card required: the scan identifies every script, connection and stored item your pages produce along with the category each one belongs to, giving you the inventory that every step above builds on.
>
> [Scan your site free](https://cookiebeam.com/sign-up?utm_source=cookiebeam-guides&utm_medium=landing-page&utm_campaign=shopify-cookie-banner-uk-gdpr-2026)

## Frequently Asked Questions

### Do Shopify apps follow the CookieBeam banner for UK shoppers?

Apps that read consent through Shopify's Customer Privacy API do, because CookieBeam relays the choice to that API. Apps that drop their own pixels without checking the API need those pixels gated the same way as any other third-party script.

### Can I keep Shopify's built-in cookie banner alongside CookieBeam?

Turn it off. Two banners means two prompts that can return conflicting answers. CookieBeam relays the choice to Shopify through the Customer Privacy API, so Shopify's own tracking still follows the visitor's decision.

### Does the banner appear at checkout?

No. Theme code doesn't run on Shopify's checkout pages. The choice the shopper made on the storefront is stored by Shopify's Customer Privacy API and carries through to checkout automatically.

### Is the UK GDPR or PECR the law that requires a cookie banner?

PECR is the statute that requires consent before storing or reading information on a device. The UK GDPR defines what valid consent looks like. Both statutes are needed to get the banner right.

### Can analytics cookies run without consent in the UK now?

In some cases. The Data (Use and Access) Act 2025 introduced an exception for analytics used solely to improve your own service, provided you give clear information and offer a straightforward way to object, and the data doesn't go beyond the provider assisting you. Analytics tools that use the data for their own advertising are unlikely to qualify. Work through the decision with your adviser; the [PECR guide](https://cookiebeam.com/guides/pecr-uk-cookie-law-post-brexit-2026) covers the conditions in detail.

## Related guides and sources

For Shopify: [Shopify's Customer Privacy API](https://cookiebeam.com/guides/shopify-cookie-consent-customer-privacy-api-2026). For the law: [PECR and UK cookie law after Brexit](https://cookiebeam.com/guides/pecr-uk-cookie-law-post-brexit-2026), [UK GDPR after Brexit](https://cookiebeam.com/articles/uk-gdpr-post-brexit-differences), [the one-click reject rule](https://cookiebeam.com/articles/one-click-reject-dark-pattern-laws-2026). Other platforms: [UK GDPR and PECR setup by platform](https://cookiebeam.com/guides/uk-gdpr-cookie-banner-setup-by-platform-2026).

Primary sources: [PECR regulation 6 (legislation.gov.uk)](https://www.legislation.gov.uk/uksi/2003/2426/regulation/6), [ICO guidance on PECR](https://ico.org.uk/for-organisations/direct-marketing-and-privacy-and-electronic-communications/).

This page summarises the law as we understand it in October 2026 for website and cookie decisions. It is not legal advice. Statutes, regulations and regulator guidance change, so check the current text with counsel before relying on any threshold or date mentioned here. CookieBeam's regional presets are configurable starting points, not a legal determination for your site.
