Guide · 18 November 2026 · 5 min read

Cookie consent basics for UK and EU websites: PECR, ePrivacy and GDPR, consent before non-essential cookies, and Google Consent Mode v2. Not legal advice.

A paper cookie jar with an amber tag hanging from the lid

By Rakibul Hasan, Moonlab

If your website serves visitors in the UK or EU and uses cookies or similar technologies that are not strictly necessary, such as analytics or advertising tags, you generally need to get consent before they are set. A banner that says by using this site you agree is not enough.

This guide explains the basics in plain terms: the rules, what counts as essential, what a compliant banner looks like and what Google Consent Mode v2 is. This is not legal advice. Rules vary by country and are interpreted by regulators, so check with a qualified adviser, and read your national regulator's guidance, such as the ICO in the UK.

The rules in short

In the UK, the Privacy and Electronic Communications Regulations (PECR) govern cookies and similar technologies, alongside UK GDPR for personal data. In the EU, the ePrivacy Directive, implemented in each country, works with the GDPR.

The common principle is that you need consent for storing or accessing information on a visitor's device, unless it is strictly necessary for a service the user asked for. Consent must meet the GDPR standard: freely given, specific, informed and an unambiguous action.

What a compliant banner looks like

Non essential cookies must not run until the visitor opts in. The banner should explain in plain words what the cookies are for, name categories and let people accept or reject as easily as each other.

Avoid pre ticked boxes, hiding reject behind extra clicks and nudging with colors in a misleading way. Let people change their mind later through a link in the footer. Keep a record of choices.

  • Accept and reject buttons with equal prominence.
  • Granular choices by category.
  • A link to your cookie and privacy policy.
  • A way to withdraw consent at any time.

Setting it up on your site

Choose a consent management platform that suits your site, such as one built into your website builder or a dedicated service. Check its pricing and whether it supports Consent Mode v2 and your country's rules.

Then test. Open your site in a private window, decline cookies and use browser developer tools to check that no analytics or ad cookies are set. Test again after any change to your tags.

What about the US?

The US has no single cookie consent law. Some states have privacy laws that give residents opt out rights for targeted advertising and the sale of data, and California's rules are a well known example. If you serve US visitors, check which state laws apply and offer clear opt out options. Ask a professional.

A worked example and common mistakes

Here is a made-up example. A furniture shop in Lyon sells across the EU and the UK, and uses Google Analytics, a Meta pixel and a live chat widget. Its banner currently says that by continuing you accept cookies, and the tags fire as soon as the page loads.

The owner replaces it with a consent platform. The banner now has Accept all, Reject all and Choose buttons of equal weight, and groups cookies into necessary, analytics and marketing. The tags are set up through a tag manager so analytics and the Meta pixel only fire after consent for their category. Consent Mode v2 is enabled so Google tags receive the visitor's choice. The chat widget is moved behind the functional or marketing category, depending on what it stores.

She tests in a private window, rejects all, and uses the browser developer tools to confirm that no analytics or marketing cookies are set. She then accepts and confirms they load. She adds a footer link to reopen settings, updates the cookie policy with the list of cookies, and schedules a quarterly check for new trackers.

A professional can confirm the setup for her markets. Here are the mistakes to avoid.

  • Loading tags before consent.
  • Making Reject harder to find than Accept.
  • Pre ticked boxes.
  • Copying a policy that lists cookies you do not use.
  • Forgetting trackers added by plugins or embedded videos.
  • No way to change your mind later.
  • Assuming a banner alone makes Consent Mode work.

How to decide and what to do this week

A short self check helps you see where you stand before you speak to a professional. Go through each point on your live site.

  • Open the site in a private window and decline everything. Are any analytics or marketing cookies set?
  • Does the banner give Accept and Reject equal prominence?
  • Is there a footer link to change your choice?
  • Does your cookie policy list what the site really uses?
  • Do you know which plugins and embeds add trackers?
  • Is Consent Mode set up, if you run Google ads or analytics for EU visitors?

How Moonlab can help

We set up consent tools, tag management and tracking in a way that respects choices. See moonlab.space/services/web-development and moonlab.space/services/data-and-analytics. For AI and data questions, see moonlab.space/guides/gdpr-ai-automation.

A free 30-minute automation audit at moonlab.space/contact can cover your tracking setup.

Common questions

Related services

More guides

Find out what you can automate.

Book a free 30-minute audit. We go through a normal week with you, list the work that can run on its own, and estimate the hours it would save.

  • 30-minute call, free
  • Fixed price before any work
  • Everything built in your accounts