Fast. Simple. No meetings. No delays.
Home / Blog / UK / UK GDPR and Cookie Consent: Building Them Into a New Website

UK GDPR and Cookie Consent: Building Them Into a New Website

How developers wire consent, analytics and data handling into a new UK-facing website — without turning the site into a banner maze.

Cover graphic for the article: UK GDPR and Cookie Consent: Building Them Into a New Website

UK GDPR cookie consent website work comes down to a few build decisions: know every cookie and script you load, keep non-essential ones switched off until the visitor agrees, record and honour their choice, collect only what forms need, and publish an accurate privacy notice. Check every legal point against current ICO guidance and an adviser.

This article is for developers and site owners building a new UK-facing website. It is not legal advice. In general terms, two sets of rules matter: data-protection law, which covers how personal data is collected and used, and the privacy and electronic communications rules, which cover storing or accessing information on a visitor's device, for example through cookies. Both are about being transparent, getting consent where it is needed, and keeping records.

The exact requirements, exemptions and enforcement positions change, so treat the Information Commissioner's Office (ICO) as your source for current guidance and have a qualified adviser review your final setup. What follows is the engineering that makes compliance possible. If your build is an application rather than a website, our article on GDPR by design for web applications takes that angle.

Categorise cookies and scripts

You cannot manage what you have not listed. Before design starts, make an inventory of everything the site stores or loads, including items added later by marketing tools.

  • Strictly necessary: things the site needs to deliver what the visitor asked for, such as session cookies, a shopping basket or security tokens. Ask your adviser how the current guidance treats these.
  • Preferences: language or layout choices remembered between visits.
  • Analytics: measurement tools. Whether they need consent depends on the tool, its configuration and current guidance.
  • Marketing and advertising: pixels, retargeting and cross-site tracking.
  • Third-party embeds: maps, videos, chat widgets and social buttons, which often set their own cookies.

For each item record its name, purpose, who sets it, how long it lasts and which category it falls under. This table feeds both your consent banner and your cookie policy.

The key technical rule is simple to say and surprisingly easy to get wrong: scripts that need consent must not run until consent is given. A banner that appears while trackers have already fired is not doing its job.

  1. Load only essential code by default.
  2. Hold analytics, marketing and embed scripts behind the visitor's choice, injecting them only after consent for that category.
  3. Give accept and reject options of equal prominence, plus a way to choose by category. Avoid designs that nudge visitors towards accepting.
  4. Do not pre-tick optional categories.
  5. Replace embeds such as videos with a placeholder until the visitor opts in.
  6. Do not block the whole site behind the banner unless your adviser says the circumstances call for it.

Be wary of tag managers: they make it easy for someone to add a tracker later that bypasses your consent logic. Route them through the same consent check.

You may need to show what a visitor agreed to, and visitors should be able to change their mind as easily as they agreed.

  • Store the choice per category, with a timestamp and the version of the banner text shown.
  • Remember the choice for a sensible period, then ask again.
  • Add a persistent link, such as "Cookie settings" in the footer, that reopens the choices.
  • When a visitor withdraws consent, stop the scripts and remove cookies you can remove, and be aware that third parties may need their own steps.
  • Decide whether you need server-side records, for instance for logged-in users, and keep them no longer than needed.

Forms and data minimisation

Many compliance problems come from forms, not cookies. For each form, ask what the data is for and whether you can do without a field. A contact form rarely needs a phone number and date of birth.

  • Collect the minimum needed and mark optional fields as optional.
  • Show a short notice near the submit button saying what you will do with the data, with a link to the privacy notice.
  • Keep marketing sign-up separate from enquiry submission, with an unticked box, so a contact request does not become a subscription.
  • Know where form submissions go: email, database, CRM or a third-party service, and who can access them.
  • Set a retention period and a way to delete old entries.

Privacy notice structure

A privacy notice should be readable by a normal person and consistent with how the site really behaves. Common elements, to be checked against ICO guidance, include:

  • Who you are and how to contact you.
  • What personal data you collect and from where.
  • Why you use it and the basis you rely on.
  • Who you share it with, including processors such as hosting and email providers.
  • Any transfers outside the UK and the safeguards used.
  • How long you keep it.
  • Visitors' rights and how to exercise them, including how to complain.

Keep the cookie policy table in sync with the inventory above. A policy that lists tools you removed, or omits ones you added, is worse than a short, accurate one.

Treat consent like any other feature and test it, ideally before every release.

  1. Open the site in a clean browser profile and check the network tab and stored cookies before touching the banner. Only essential items should appear.
  2. Click reject and confirm nothing non-essential loads on later pages.
  3. Accept one category and confirm only that category's scripts load.
  4. Withdraw consent and confirm the scripts stop.
  5. Test on mobile, with a screen reader and by keyboard, since the banner must be usable.
  6. Run a periodic scan to catch new trackers added through plugins or tag managers.

Putting it together

Make the cookie inventory, wire the consent gate before launch, simplify forms, and ask an adviser to check the notice against current ICO guidance. For a new build with consent designed in from the start, our UK web and software development service is delivered remotely, and our guide to fixing Core Web Vitals shows how to keep third-party scripts from slowing the site.

Frequently asked questions

Do all cookies need consent?

Not necessarily. Guidance generally treats cookies that are strictly necessary for something the visitor requested differently from analytics or marketing cookies, but the detail and exemptions change. Inventory every cookie, classify it, and confirm the current position with the ICO or a qualified adviser before deciding which ones wait for consent.

How do I test that scripts wait for consent?

Use a clean browser profile, open developer tools and check the network and storage panels before interacting with the banner. Only essential items should appear. Then test reject, accept by category and withdrawal, confirming each time that scripts load or stop accordingly. Repeat before each release.

What should a privacy notice contain?

At a general level: who you are, what personal data you collect and why, the basis you rely on, who receives it, any transfers outside the UK, how long you keep it, and visitors' rights including how to complain. Check the exact content against current ICO guidance and adviser review.

Related articles

Web Development Tel Aviv

Startup Landing Page Launch Checklist

Everything a startup landing page needs before launch: message, speed, forms, analytics, metadata, privacy text and tracking.

6 min read

🚀 Start Now