Skip to content

Cookie consent

What is a cookie banner, and how does it work?

By the Kiescy teamUpdated 6 min readChecked against the official text on

You've seen thousands of them: the box asking you to "Accept all" or "Manage preferences". If you run a website, it matters what that box actually does, because a banner that only looks right can still leave you breaking the law. This guide explains what a cookie banner is, what happens behind the scenes when someone clicks, and how to test whether yours works.

The short version

A cookie banner is a message that asks website visitors whether they accept non-essential cookies, such as analytics and advertising, before those cookies are used. A working banner does three things behind the scenes: it holds back tracking scripts until the visitor chooses, remembers the choice, and records it as proof. Laws in the EU, UK, India and elsewhere require one when a site uses non-essential cookies. Many banners only display a message while trackers load anyway, which counts as no consent at all.

Words you'll see in this guide (5)
Cookie:
A small text file a website stores in your browser, used to remember things like your login, your cart, or that you've visited before.
Tracker:
Any technology that follows what visitors do: cookies, pixels, local storage and scripts from analytics and ad companies.
Consent:
A visitor's clear, active choice to allow something, given before it happens (GDPR Article 4(11)).
Consent management platform (CMP):
Software that runs a cookie banner, blocks trackers until consent and stores a record of each choice.
Script blocking:
Stopping tracking code from running until the visitor agrees.
On this page
  1. Why they exist
  2. How it works
  3. Decorative banners
  4. Test your banner
  5. What good looks like
  6. How the pieces fit
  7. Cookie walls
  8. Add one
  9. Questions
  10. Sources

Why websites have cookie banners

Cookie banners exist because of the law. Article 5(3) of the EU's ePrivacy Directive says a website may store or read information on a visitor's device only with their consent, unless it's strictly necessary for a service they asked for. The GDPR then set the bar for valid consent: freely given, specific, informed and unambiguous, by a clear action such as clicking a button.

Other places followed. The UK has the same core rule (with some exemptions for first-party analytics since February 2026), India's DPDP Act requires consent for processing personal data from May 2027, and Brazil's LGPD points the same way. Most US states use an opt-out model instead. For the rules by country, see is a cookie banner required?

What happens when a visitor clicks

  1. Page loads

    The page and its essential cookies load. Analytics, advertising and embedded videos are held back.

  2. Banner appears

    It explains what the cookies are for and offers Accept all, Reject all and Customise.

  3. Visitor chooses

    The banner saves the choice in a small cookie of its own. That cookie is strictly necessary, so it doesn't need consent.

  4. Scripts run or stay blocked

    If analytics was accepted, Google Analytics now loads. If marketing was rejected, the Meta Pixel never runs.

  5. Signals go out

    With Google Consent Mode v2, the banner tells Google's tags what was allowed, so they behave accordingly.

  6. Choice is recorded

    A consent log stores the time, the choice and the banner version, as proof.

  7. Any time later

    A "Cookie settings" link lets the visitor change their mind.

Example

Emma visits an online bookshop from Berlin and clicks "Reject all". Google Analytics and the Meta Pixel never load, Google receives a "denied" signal, and her choice is logged. She keeps browsing normally, and her cart still works thanks to a strictly necessary cookie.

The most common problem: banners that don't block anything

Many banners are only decorative. They show a message and save a choice, but the tracking scripts load as soon as the page opens, before anyone clicks. It's especially common when a theme, page builder or tag manager adds analytics on its own, outside the banner's control.

Legally, that's the same as having no banner: the trackers ran without consent. Regulators check what loads, not how the banner looks.

How to test your own cookie banner in 2 minutes

  1. Open your site in a private or incognito window, so no earlier choice is remembered.
  2. Open the browser's developer tools (F12, or right-click and choose Inspect) and go to the Network tab. Reload the page.
  3. Don't click the banner. Type google-analytics, facebook, doubleclick or tiktok in the Network filter. If anything shows up, it loaded before consent.
  4. Go to Application → Cookies and look for _ga, _fbp or _gcl_au. They shouldn't exist yet.
  5. Now click Reject all, reload, and repeat both checks. Still nothing should appear.
  6. Click Accept all and reload: now the trackers should load. If they don't, your banner is blocking too much.

Tip: Prefer not to dig through developer tools? The free website check does steps 1 to 4 for you and lists every tracker that loads before a choice.

What makes a good cookie banner

European regulators agreed on a common position in the EDPB's Cookie Banner Taskforce report. In plain words, a good banner has:

  • Honest wording that says plainly what the cookies are for.
  • Equal choices: Reject all is as easy and visible as Accept all, on the first screen.
  • Categories off by default: no pre-ticked boxes.
  • No tricks: no hidden reject link, no colours designed to push people to Accept.
  • Real blocking: nothing non-essential loads before a choice.
  • An easy way back: a cookie settings link in the footer.
  • Proof: each choice is recorded (GDPR Article 7(1)).
  • Regional behaviour: opt-in where the law requires it, opt-out where it doesn't.

See real designs and wording in cookie banner examples, and what each category means in GDPR cookie categories.

Banner, cookie policy, consent mode and logs: how they fit together

PieceWhat it doesRequired?
Cookie bannerAsks for and saves the visitor's choice; blocks scripts until thenWhere you use non-essential cookies and have visitors from opt-in regions
Cookie policyLists each cookie with its purpose and how long it lasts; linked from the bannerThe information must be given; a separate page is the usual way
Privacy policyExplains all your personal data use, including cookiesAlmost always
Google Consent Mode v2Passes the choice to Google's tagsNeeded to keep Google ads features for EEA and UK traffic
Consent logsStored records of what each visitor choseYou must be able to prove consent

More detail: cookie policy vs privacy policy and Consent Mode v2 basic vs advanced.

Cookie banners vs cookie walls

A cookie wall blocks the whole site until the visitor accepts tracking. Most European regulators consider that consent isn't freely given if refusing means losing access, so cookie walls are generally not allowed for ordinary websites. Some publishers offer a "consent or pay" choice instead; that model is contested and under active review by regulators. For most sites, a banner that lets people reject and keep browsing is the safe choice.

How to add a cookie banner to your site

  • Free and simple: the free cookie banner generator creates code you paste into your site. It blocks marked scripts until consent and supports Consent Mode v2.
  • Built into your platform: Shopify and some site builders include basic banners. Test them with the steps above, because many don't block third-party scripts.
  • Managed: Kiescy's consent banner adds regional rules, automatic cookie scanning and consent logs with one script tag. See the install guides for your platform.

Questions

What does a cookie banner do?

It asks visitors for permission to use non-essential cookies, holds back trackers until they choose, saves the choice and records it as proof.

What happens if I click Reject all?

On a properly set-up site, analytics and advertising scripts never load for you. Strictly necessary cookies, like your shopping cart, still work.

Is a cookie banner the same as a cookie policy?

No. The banner collects consent; the cookie policy is a page that explains each cookie in detail. The banner links to the policy.

Why do I see the same cookie banner on every visit?

Usually because the site couldn't save your choice: you're in private browsing, you cleared your cookies, or the site's banner is misconfigured.

Do cookie banners hurt SEO?

Not in themselves. Google's guidance exempts interstitials that sites must show by law, and advises against sending users to a separate page for consent. Keep the banner as an overlay that doesn't cover the whole screen on mobile.

Does a cookie banner need to block Google Fonts or a CDN?

Files served from third parties can share the visitor's IP address with them, and some European courts have objected to that for Google Fonts. Self-hosting fonts avoids the question entirely.

Sources

The facts in this guide come from these official sources, last checked on . We review the guide whenever they change.

  1. ePrivacy Directive 2002/58/EC, Article 5(3) (EUR-Lex)
  2. GDPR, Regulation (EU) 2016/679 (EUR-Lex)
  3. EDPB: Report of the work undertaken by the Cookie Banner Taskforce (2023)
  4. ICO: Guidance on the use of storage and access technologies
  5. Google Search Central: Avoid intrusive interstitials and dialogs

Does your banner actually block?

The free check loads your site as a first-time visitor and lists every tracker that fires before anyone clicks.

Open the free tool

This guide explains the law in general terms and isn't legal advice. Laws change and how they apply depends on your situation; for high-risk processing, ask a lawyer.

Keep reading

All guides

Get compliant this afternoon, not this quarter.

Set up your policies, banner and request form in one place. Free while Kiescy is in early access.