UK product engineering & compliance

Cookie consent and Google Consent Mode for UK sites

Two rulebooks land on one banner: UK law decides whether you may set the cookie, and Google decides whether your advertising keeps running.

Ritesh AgarwalSep 10, 20268 min read
Get consent wrong and lose the ads: a Consent Debt Score by signal, from tags firing early to no record of the choice

Direct answer

A UK cookie banner has to satisfy two separate rulebooks at once. UK law, the Privacy and Electronic Communications Regulations read with UK GDPR, decides whether you may store a non-essential cookie: you need prior consent, a reject option as easy as accept, and a record of the choice. Google decides whether your advertising keeps working: Consent Mode v2 for advertisers, and a Google-certified CMP for serving ads to EEA and UK visitors. Build one setup that answers both. Load the CMP before any tag, default every storage type to denied, unblock tags only on consent, and pass Google the signals it expects.

UK lawMay you set it?PECR consent, reject-all parity, a durable record. Fines to £17.5m.
Google rulesDo the ads work?Consent Mode v2 signals, and a certified CMP for EEA and UK ad serving.
One buildGate, then signalCMP first, default denied, unblock on consent, store the choice.

Key takeaways

  1. A banner is required whenever you set a non-essential cookie. Analytics, ads and most embeds count.
  2. Reject all must be as easy as accept all, on the first layer. Accept and Customise alone is the illegal one.
  3. Since 5 February 2026 the maximum PECR fine matches UK GDPR: £17.5m or 4% of turnover.
  4. Consent Mode v2 is Google's rule, not the law. Skip it and remarketing, audiences and measurement degrade.
  5. The CMP must load before the tags, and tags stay blocked until consent. Most broken setups fail this line.

What UK law actually asks for

The rule is older than most of the tools that sell against it. Regulation 6 of PECR has required consent before storing or reading information on a user’s device since 2003, and UK GDPR sets the standard that consent must meet: a freely given, specific, informed and unambiguous opt-in. This is the compliance half of our UK engineering and compliance work, and it sits next to the same evidence discipline we describe for overseas teams handling UK personal data.

01 · ConsentAsk before you set

Prior opt-in for analytics, advertising pixels and most third-party embeds. The strictly necessary exception is narrow: it covers only what a service the user explicitly requested cannot run without.

ICO: cookies and similar technologies

02 · ChoiceReject as easily as accept

A reject-all control on the first layer, equal in weight to accept. No pre-ticked boxes, no consent inferred from scrolling, and withdrawing consent must be as easy as giving it.

03 · RecordKeep the proof

Store what was consented to, when, and which banner version served it. If a regulator or a customer asks, the answer is a record, not a screenshot of the current site.

These cookies are the usual strictly necessary set that does not need consent. Everything else does.

Login and sessionShopping basketSecurity and CSRF tokenLoad balancingThe consent choice itself
The 2026 relaxation is narrower than it reads. The Data (Use and Access) Act 2025 brought new PECR exemptions into force on 5 February 2026, including first-party analytics used solely to gather aggregate statistics to improve your own service, provided you give clear information and a simple, free way to object. Standard Google Analytics rarely qualifies, because it also feeds Google’s own advertising systems, so “solely” fails. Treat GA as still needing consent and reserve the exemption for genuinely first-party, self-hosted measurement. ICO: the Data (Use and Access) Act 2025

Two rulebooks, one banner

UK LAWPECR reg 6 + UK GDPRconsent before non-essential cookiesfreely given · reject as easy as acceptWhat it requiresprior consent, reject-all on the first layerclear information + a record of the choicethe 2026 analytics exemption is narrowIf you failICO enforcement · up to £17.5m or 4% turnoverGOOGLE PLATFORM RULESConsent Mode v2 + certified CMPadvertisers: consent signals since Mar 2024ad serving: certified CMP + IAB TCFWhat it requiresad_user_data + ad_personalization signalsa Google-certified CMP for EEA / UKsignals sent on every pageIf you failpersonalised ads, remarketing, audiences offOne CMP + tag setup for bothblock tags until consent → Consent Mode signalsreject-all parity → certified CMPFIG. 02TWO OBLIGATIONS
Fig. 02 One banner answers two separate rulebooks. UK law decides whether you may set the cookie; Google decides whether your ads keep working. A setup can pass one and fail the other.scroll →

Most teams only ever think about one of these. In our own delivery records the word “PECR” barely appears; everything is framed as “the Consent Mode deadline” or “a Google consent-policy violation”. That is backwards. PECR is the law that now carries the £17.5m fine, up from a £500,000 cap. Google’s requirement is a commercial gate on your ad features. A banner tuned to keep Google happy can still break the law, and a banner that is legally clean can still switch your ads off if the Consent Mode signals never reach Google.

Google has two distinct requirements, often confused. Advertisers using Google Ads or GA4 must send Consent Mode v2 signals for EEA and UK users, in force since March 2024. Publishers serving ads through AdSense, Ad Manager or AdMob must additionally use a Google-certified CMP integrated with the IAB Transparency and Consent Framework, in force since 16 January 2024. Fail the first and measurement degrades. Fail the second and personalised ads stop serving.

THE GATE · BUILD THIS BEFORE ANY TAGPage requestbrowser loadsthe pageCMP loads firstbefore GTMbefore any tagDefault: deniedgtag consent defaultall storage offVisitor choiceAccept all · Reject allequal, on the first layerIF GRANTEDConsent grantedad_storage / analytics_storage onad_user_data / ad_personalization onGA4, Google Ads, Meta tags fireIF REJECTEDConsent deniedstorage stays off, no cookiesConsent Mode cookieless pingsGA4 / Ads modelling fills the gapFIG. 01CONSENT GATE
Fig. 01 The consent management platform loads before any tag and defaults every storage type to denied. The visitor's choice either unblocks tags or leaves Google modelling the gap from cookieless pings.scroll →

Consent Mode v2 is four signals. Two of them, ad_storage and analytics_storage, change how the tags behave on your page by controlling whether cookies are written. The two added in v2, ad_user_data and ad_personalization, are signals sent to Google that carry no on-page effect but decide whether Google may use the data for advertising and remarketing.

SignalControlsDenied means
ad_storageAdvertising cookies and identifiersNo ad cookies stored or read on the page
analytics_storageAnalytics cookiesNo analytics cookies; GA4 may model the gap
ad_user_dataSending user data to Google for adsData is not sent for advertising purposes
ad_personalizationRemarketing and audiencesNo remarketing lists or audience building

You then choose how the tags load, and the choice is a real trade-off.

Basic mode

Google tags are blocked until the visitor interacts with the banner. Nothing is sent before that.

  • Simplest and the strictest reading of PECR
  • No data and no modelling before a choice
  • Lower recovered conversions
vs
Advanced mode

Tags load with consent defaulted to denied and send cookieless pings, which lets Google model conversions.

  • Recovers measurement from users who reject
  • More to configure and to get wrong
  • Needs the default-denied block in place first

For most UK sites that spend on Google or Meta, use advanced mode: the modelled conversions are worth the extra care, and the default-denied block is the same line PECR wants anyway. Wiring this into a WordPress theme and its tag manager is exactly the kind of work a CMP wired correctly into a WordPress build needs, rather than a plugin dropped in and left on defaults. The minimum, provider-agnostic pattern is a default-denied block before any tag, then an update on consent.

Default every storage type to denied, then update on the visitor's choicehtml
<!-- Load the consent platform before any Google or marketing tag. -->
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){ dataLayer.push(arguments); }

  // Deny everything until the visitor chooses. This is the line most sites miss.
  gtag('consent', 'default', {
    ad_storage: 'denied',
    ad_user_data: 'denied',
    ad_personalization: 'denied',
    analytics_storage: 'denied',
    functionality_storage: 'granted',
    security_storage: 'granted',
    wait_for_update: 500,
  });
</script>

<!-- The consent platform calls this when the visitor accepts a category. -->
<script>
  function onConsentChange(choice) {
    gtag('consent', 'update', {
      ad_storage: choice.marketing ? 'granted' : 'denied',
      ad_user_data: choice.marketing ? 'granted' : 'denied',
      ad_personalization: choice.marketing ? 'granted' : 'denied',
      analytics_storage: choice.analytics ? 'granted' : 'denied',
    });
  }
</script>

What breaks in production

For this guide we went back through our own UK delivery records. Client names are withheld. These are the failures that actually cost money, and the rule each one taught.

2024CMP disabled, tags vanished

With Consent Mode v2 the CMP loads the tag manager. During a plugin cleanup the CMP was switched off, the container stopped injecting, and nothing errored. Analytics and ads data simply went quiet.

The CMP owns the tag loader. It is not a removable extra.
2025A banner froze the checkout

A JavaScript error inside the consent banner stopped third-party scripts loading and left the buttons undismissable. Orders stopped for hours on a live store, with no deploy that day.

Consent sits on the critical path. It must fail open, not closed.
2026Consent set to yes before any click

On a fresh browser the banner sometimes did not render, and the consent cookie was written as accepted with no interaction.

Test in a cookieless session. A banner that auto-consents is evidence against you, not for you.
2025The bridge plugin looked optional

The small plugin that signals consent state to analytics was deactivated in a cull of unused plugins. Consented UK tracking broke silently, and the client asked for it to stay on permanently.

The consent bridge is load-bearing, not clutter.
2026A checkbox that recorded nothing

A marketing-consent checkbox posted with the wrong field-key format was dropped without error, so leads arrived with no recorded consent behind them.

Confirm the consent value lands in the record, not just in the form.
2025Ads off before the ICO ever called

A Google Ads account was flagged for a consent-policy violation because several sites in a portfolio had no banner at all. The fix was a CMP rollout across four sites in days.

The ad account pays for missing consent long before a regulator does.
  1. Load the CMP before any tag and default to denied. Blocking first is what the law wants and also the technical default that keeps Google’s signals honest. The same line solves both.
  2. Monitor for the absence of data. Broken consent rarely throws an error; it just goes quiet. Alert on a drop in events and conversions, not only on exceptions.
  3. One property is not one site. A WordPress plugin does not reach a separate booking portal or storefront on another stack. Each surface needs its own consent layer.

The Consent Debt Score

The Consent Debt Score is our triage model for an existing site. It does not decide whether you are lawful. It tells you how much revenue and regulatory exposure your current consent setup is carrying, and how urgently to act.

Consent Debt Score0–12
+4Non-essential tags, pixels or analytics fire before the visitor chooses
+3Personalised ads, remarketing or audiences run for EEA or UK users with no Consent Mode v2 or certified CMP
+2Reject all is missing from the first layer, or harder than accept all
+2Tags load outside the CMP: hardcoded in the theme, a second container, or a plugin the scan never sees
+1No durable consent record, or analytics leans on the 2026 exemption while feeding Google’s ad systems
0–2 · Compliant enoughKeep the cookie scan and the record current. Re-check after any tag or theme change.
3–6 · Fix the wiringAdd reject-all parity, block non-essential tags until consent, wire Consent Mode v2, then re-scan.
7–12 · Rebuild consent nowYou are losing ad performance and carrying fine exposure at once. Fix before the next campaign.

A brochure site with a working certified CMP and no advertising scores one or two. An ad-spending store firing Meta and Google pixels on page load, with an Accept-only banner and a second tag container the scan never sees, scores nine or more. Same banner on the surface, very different exposure underneath.

A real boundary: one CMP, two platforms

The hardest consent problem we hit is not the banner. It is coverage. Take a UK clinic whose website and store we build and run: the marketing site is WordPress, with a certified CMP that bundles Consent Mode v2, and the booking and commerce flow lives on a separate stack on its own subdomain. A WordPress consent plugin cannot reach that second surface. Any tracking on the portal is unconsented until it gets its own consent layer, either a second certified CMP or a hand-coded default-denied block like the one above. Getting identical, cross-domain consent on both surfaces, so a visitor’s choice on one is honoured on the other, is the real engineering work.

01Inventory the tagsEvery script, pixel and embed, per surface
02Load the CMP firstBefore the tag manager; default denied
03Wire Consent Mode v2Signals on grant; reject-all parity
04Record and monitorStore the choice; alert on data drops

What our production record shows is worth stating plainly. On WordPress and Shopify we run Complianz, a Google-certified CMP that bundles Consent Mode v2, standardised across a partner agency’s UK portfolio under one agency licence; CookieYes is our default where a WordPress plugin is not the right fit; and a plugin-free CMP covers a separate portal that no plugin can reach. On a custom build we gate analytics behind a consent state in the application itself, send the four Consent Mode signals and add a withdraw link, which is the same consent behaviour a SaaS site’s measurement setup depends on. We have never shipped a bespoke consent platform where a certified one already exists, because Google’s ad rules require the certification, not our code.

Recommendations by business type

UK ecommerce and retailGate the pixels, keep the ads legal

Meta and Google pixels are non-essential. Block them until consent, wire advanced Consent Mode v2, and keep the banner off the checkout critical path so a script error never stops orders.

UK lead generation and servicesMake reject-all the default posture

Reject-all on the first layer, a marketing-consent checkbox that actually records, and analytics you can defend without relying on the 2026 exemption. On a UK web build, put consent in the acceptance criteria at the start of the project, not after launch.

UK SaaS and appsOwn consent in the codebase

Gate analytics behind a consent state, send the four signals and give users a withdraw path. The database console and a third-party snippet are not a consent record.

Agency or multi-site ownerStandardise on one certified CMP

One Google-certified CMP across the portfolio, one licence, one scan cadence. A missing banner on a single site is an ad-policy violation for the whole account.

Our ruleUK law decides whether you may set the cookie. Google decides whether your ads survive it. One banner has to answer both, or you lose money to whichever notices first.

Frequently asked questions

Do I need a cookie banner for a UK website in 2026?
If you set any non-essential cookie, yes. Analytics, advertising pixels and most third-party embeds are non-essential and need prior consent under PECR. Strictly necessary cookies, such as login, basket and security tokens, are exempt. Since 5 February 2026 first-party analytics used solely to improve your own service can be exempt, but only if you give clear information and an easy way to object, and the exemption does not cover advertising.
Is an Accept button without a Reject option allowed?
No. The ICO says rejecting all non-essential cookies must be as easy as accepting them, with the reject control on the first layer of the banner. A banner offering only Accept and Customise is the pattern the ICO has publicly called non-compliant.
What is Google Consent Mode v2 and does a UK site need it?
Consent Mode v2 passes the visitor's consent state to Google through four signals, including ad_user_data and ad_personalization. Google has required it since March 2024 for EEA, UK and Swiss traffic. Without it, Google Ads and GA4 lose remarketing, audiences and full conversion measurement for those users.
Do PECR and Google's rules ask for the same thing?
No, and this is where teams go wrong. PECR and UK GDPR decide whether you may store the cookie at all, with fines now up to £17.5m or 4% of turnover. Google's rules decide whether your advertising keeps working: Consent Mode v2 for advertisers, and a Google-certified CMP for serving ads to EEA and UK visitors. A setup can satisfy one and fail the other.
Does Appycodes build its own cookie banner?
On WordPress and Shopify we configure an off-the-shelf, Google-certified CMP, because Google's ad rules require the certification, not our code. On a custom build we gate analytics behind a consent state in the application itself, send the four Consent Mode signals and add a withdraw path. We do not ship a bespoke consent platform where a certified one already exists.

Primary sources

Published 10 Sep 2026Reviewed 10 Sep 2026Reviewer Appycodes Editorial Team

Technical and operational guidance, not legal advice.

The engagements this writing comes from

UK · Europe · Worldwide

selected work

Where these numbers came from

Production systems with the delivery figures attached.

Creoate product interface01
B2B commerce

The engineering partnership behind a cross-border wholesale marketplace.

Next.js storefront, Python ingestion pipelines, DynamoDB data layer and AWS infrastructure.

8+ yearsone team, still shipping
Ontick product interface02
Event technology

A commission-free ticketing platform built for ownership and scale.

Multi-organiser commerce, Stripe instalments and two native apps in one connected platform.

£2M+processed since launch
Easyship product interface03
Global logistics

Embedded product engineering for a global shipping platform.

Rate, tax and duty calculators, server-rendered courier pages and a custom MongoDB CMS.

550+couriers on the calculator
TEFL.ie product interface04
Education & training

A course-commerce and learning platform wired into one system.

WordPress and WooCommerce, a Moodle LMS, Stripe deposits and Zoho CRM, tied together with Zapier automation.

8 yrsengineer & run, since 2017
All White Laser product interface05
Medical aesthetics

A bespoke platform that finances aesthetic machines on Direct Debit.

A lead-to-billing system on GoCardless Direct Debit, provider certification, and a React Native app for machine owners.

9 yrsbuild & run, since 2017
Decofetch product interface06
Luxury commerce

A custom furniture marketplace engineered from storefront to infrastructure.

Server-rendered Next.js commerce over a Laravel API, bespoke operations tooling and re-architected AWS infrastructure.

0→livecustom, front to back
BA Engine Room product interface07
AI operations

An AI-native operating system that runs a consultancy lead to invoice.

Discovery briefs, e-signed contracts, Stripe deposits, delivery milestones and time tracking in one operational system.

0→1built from the ground up
PlusHeat product interface08
Home services

A conversion platform for a growing UK boiler-cover provider.

Custom plan configuration, postcode-qualified lead journeys, CRM synchronisation and campaign landing pages.

5 yrsweb partner since 2021
Léonia product interface09
Beauty commerce

A custom Shopify store for a French beauty brand.

Custom theme, customer accounts, loyalty rewards, referrals and gift-with-purchase offers.

5 yrspartners since 2021
Shutters 365 product interface10
Home improvement

Made-to-measure shutters with live pricing.

A seven-step product builder with live previews, sample orders and supplier tools.

7-stepconfigurator, live pricing
Bloc Ads Manager product interface11
Advertising

A self-service advertising platform for venues.

Campaign creation, audience targeting, in-app ads and reporting linked to venue check-ins.

check-insclosed-loop attribution
Bloc product interface12
Social events

An events app with the tools to run it.

Mobile app, backend, advertising tools, a digital marketplace and website.

4+ yrsone team, five codebases
Zonely product interface13
Social mobile

Two mobile apps for real-time companionship.

Customer and buddy apps with per-minute billing, wallets, moderation and admin tools.

2 appsconsumer + buddy, iOS & Android
Player Profile Hub product interface14
Grassroots football

Player profiles and discovery for youth football.

Verified profiles, video highlights, coach discovery and safeguarding on web and mobile.

0→1built from the ground up
DeepSpatial product interface15
Geospatial AI

Websites and a talent platform for DeepSpatial.

Corporate and investor pages, the Xploor talent platform and ongoing releases on AWS Amplify.

2 yrsone team, ongoing
Yippee Malta product interface16
Travel

Tour bookings with a custom mobile-first checkout.

A multilingual website connected to the booking API, with deposits, coupons and affiliate tracking.

90+core web vitals, mobile & desktop
Professional Energy product interface17
Energy brokerage

One platform for tenders, contracts and accounts.

Supplier tenders, contract management, brokerage accounting and client records.

100+suppliers in one tender

Tell us what you are trying to build.

A thirty-minute call with the engineer who would run it.

Book a call