Website cookies and consent in the UK: what businesses need to know

When your website needs cookie consent, what a compliant cookie banner looks like, and how to keep analytics working within the rules.

By the UK Technology Hub teamPublished 4 minute read

The short answer

Under UK law, websites generally need consent before setting non-essential cookies, such as most advertising and many analytics cookies. Strictly necessary cookies, such as those for a shopping basket or security, don't need consent. A compliant banner explains cookies clearly, makes rejecting as easy as accepting and doesn't set non-essential cookies until people agree.

Cookies are small files that websites store on visitors' devices. Some are essential for a site to work; others track behaviour for analytics or advertising. UK law sets rules on when you need consent. This guide is general information, not legal advice.

The rules: PECR and UK GDPR

The Privacy and Electronic Communications Regulations (PECR) cover cookies and similar technologies, such as tracking pixels and local storage. They require you to:

  • Tell people what cookies you use and why.
  • Get their consent for cookies that aren't strictly necessary.

Where cookies involve personal data, UK GDPR also applies, with its standard of clear, freely given, informed and unambiguous consent.

The Data (Use and Access) Act 2025 changed some of these rules, including new exemptions from consent for certain low-risk purposes, such as some analytics, subject to conditions like giving clear information and an easy way to object. Check the ICO's current guidance to see how and when these exemptions apply to your site.

Strictly necessary cookies

These don't need consent. They're essential to provide a service the user has asked for, such as:

  • Keeping items in a shopping basket.
  • Keeping users logged in.
  • Security features, such as preventing fraudulent form submissions.
  • Remembering cookie consent choices.
  • Load balancing.

You still need to tell people about them in your cookie policy.

Non-essential cookies

Traditionally these require consent:

  • Analytics cookies, such as Google Analytics, unless a new exemption applies to your specific set-up.
  • Advertising and retargeting cookies, such as those from Meta, Google Ads and LinkedIn.
  • Social media embeds that set tracking cookies.
  • Personalisation cookies that aren't essential.
  • Clear information about what cookies are used for, in plain language.
  • Accept and reject options with equal prominence. Rejecting should be as easy as accepting, in the same place.
  • No pre-ticked boxes for non-essential cookies.
  • Granular choices for different purposes, such as analytics and marketing.
  • No non-essential cookies before consent. Scripts must wait until the user agrees.
  • An easy way to change your mind, such as a link in the footer.

The ICO has taken an interest in cookie banners that make rejecting harder than accepting, so this matters.

Common mistakes

  • Banners with only an "Accept" button.
  • Analytics and advertising scripts loading before consent.
  • "By continuing to browse you accept cookies" messages.
  • Cookie policies copied from templates that don't match the cookies actually used.
  • Forgetting cookies set by embedded videos, maps and chat widgets.

Analytics within the rules

Measuring your website is important, and there are compliant ways to do it:

  • Google Analytics 4 with Consent Mode: GA4 can adjust how it works based on consent choices. Our GA4 guide explains how this fits together.
  • Privacy-focused analytics tools that don't use cookies or personal data may fall within exemptions or need lighter consent, depending on how they work.
  • Server logs give basic traffic information without client-side tracking.

Check how each tool works and the current ICO guidance before deciding whether consent is needed.

How to audit your website's cookies

  1. List every script and embed on your site: analytics, ads, chat widgets, videos, maps, fonts and forms.
  2. Scan your site with a cookie scanning tool or your browser's developer tools to see which cookies are set.
  3. Categorise each cookie as strictly necessary or non-essential.
  4. Check scripts wait for consent before loading.
  5. Update your cookie policy to match.
  6. Repeat when you add new tools.

Cookies and website performance

Every tracking script adds weight to your pages and can slow them down. An audit is a good opportunity to remove tools nobody uses. Fewer scripts mean faster pages and less to manage, which also helps your website security.

Online shops

E-commerce sites often have many apps that set cookies for reviews, recommendations, chat and advertising. Check each app's cookies and make sure your consent tool controls them. Our e-commerce builds include consent set-up for store apps.

How we can help

Sites built through our web development service only load non-essential scripts after consent, with banners designed to be clear and fair. Our maintenance plans include periodic checks as tools and rules change.

Frequently asked questions

Do I need a cookie banner if I only use Google Analytics?

Usually some form of notice and choice is needed. Recent law changes added exemptions for certain analytics, so check the ICO's current guidance for your set-up.

Can I use a 'reject all' button?

Yes, and you should. Rejecting non-essential cookies should be as easy as accepting them.

Do I need a cookie policy?

Yes. You must tell people what cookies you use and why, even for strictly necessary ones.

This guide is general information, not legal, tax or financial advice, and details such as prices, features and rules can change. Product and company names mentioned are trademarks of their respective owners and are used only to identify those products; UK Technology Hub is not affiliated with or endorsed by them.

Related guides

All SEO, security & maintenance guides