Compliance guide
Do I Need a Cookie Consent Banner?
Short answer: if your site is accessible to EU or UK visitors and uses any non-essential cookie — Google Analytics, advertising pixels, Hotjar, social widgets — you need prior consent before those cookies fire. Here's the exact rule, what counts as essential, and what valid consent actually requires.
- Which laws apply
- Essential vs. non-essential
- What valid consent requires
- Patterns that fail
- US-only sites
- What the banner must contain
- Generate a compliant banner free
- FAQ
Which laws govern cookie consent
Cookie consent is primarily governed by two overlapping frameworks in the EU and UK — the ePrivacy Directive (the "Cookie Law") and GDPR. In the US, there is no federal cookie consent law, but California's CPRA creates related opt-out obligations when advertising cookies are in play.
| Law | Region | What it requires |
|---|---|---|
| ePrivacy Directive (2002/58/EC) | EU | Requires prior informed consent before storing or accessing non-essential information on a user's device. This is the direct source of the cookie consent requirement — GDPR sets the consent standard. |
| GDPR (EU) / UK GDPR | EU, UK | Defines what valid consent means: freely given, specific, informed, unambiguous, and withdrawable. Sets the standard that the ePrivacy Directive's consent requirement must meet. Also governs how personal data collected via cookies is processed. |
| UK PECR | UK | The UK's Privacy and Electronic Communications Regulations — the UK equivalent of the ePrivacy Directive post-Brexit. Functionally the same cookie consent requirement, enforced by the ICO. |
| CCPA / CPRA (California) | US (California) | No prior cookie consent required. Instead: if you "share" personal data (including via advertising pixels) for cross-context behavioral advertising, California residents have a right to opt out. Requires a "Do Not Sell or Share My Personal Information" link — not a consent banner. |
| US federal law | US (federal) | No federal cookie consent requirement exists as of 2026. General FTC authority over deceptive practices applies if your cookie notice is materially false, but there is no prescriptive cookie banner mandate. |
The practical upshot: if your site is publicly accessible — which means EU and UK visitors can reach it — both the ePrivacy rules and GDPR apply to how you set cookies on those visitors' devices. Non-EU companies are not exempt; the rules apply based on where the user's device is located, not where your server or company is.
Essential cookies vs. non-essential cookies
The single most important distinction is between cookies that are strictly necessary for a service the user has explicitly requested (no consent needed) and cookies that serve any other purpose (consent required). Here is how to tell them apart:
The "strictly necessary" test is stricter than most people assume. A cookie is not essential just because your site uses it heavily — it is essential only if removing it would prevent the user from receiving the service they came to use. Analytics, by definition, serves the site owner's purpose (measuring traffic), not the user's purpose (using the tool). It is never essential.
What valid consent requires under GDPR
Under GDPR Article 4(11), consent must be freely given, specific, informed, and an unambiguous indication of the data subject's wishes. The European Data Protection Board (EDPB) has clarified each of these requirements in enforceable guidelines. Here is what each means in practice:
Before consent is given, non-essential cookies must not fire. This means your analytics, advertising, and session recording scripts must be blocked until the user actively accepts — not loaded on page start and then retroactively disclaimed.
Common patterns that fail — and why
These are the implementations regulators have specifically ruled against. Each one is still widely deployed, which is why enforcement actions keep citing them:
- "This site uses cookies" notice with only a Close or Got It button Dismissing a banner is not an affirmative action and does not constitute consent. Loading non-essential cookies on page load before any interaction occurs — while displaying this banner — violates ePrivacy regardless of what the banner says. Regulators from the ICO, CNIL, and German DPAs have fined this pattern.
- Pre-ticked analytics or advertising checkboxes GDPR Article 7(2) states that if consent is given in a written declaration covering other matters, the request for consent must be clearly distinguishable; recital 32 explicitly rules out pre-ticked boxes. A checkbox that is checked by default, requiring the user to actively uncheck it, does not constitute freely given consent.
- Implied consent through scrolling or continued use The EDPB Guidelines 05/2020 on Consent explicitly state: "Scrolling or swiping through a webpage or similar user activity will not under any circumstances satisfy the requirement of a clear and affirmative action." A banner that says "By continuing to browse, you consent to cookies" and then sets analytics cookies does not satisfy GDPR.
- Cookie wall — access denied unless cookies are accepted GDPR requires consent to be freely given. Access to a site conditioned entirely on accepting advertising or analytics cookies is not freely given consent, according to EDPB Guidelines 05/2020. The European Court of Justice affirmed this principle in the Planet49 ruling. A paid, cookie-free alternative may create a compliant alternative, but a simple accept-or-leave wall does not.
- Accept button visually prominent, Reject buried or absent Dark patterns — making the Accept button large and green while making Reject a small grey link, or requiring extra clicks to reject — have been the subject of substantial fines (the French CNIL fined Google €150M and Facebook €60M in 2022 specifically for this pattern). The two options must be equally prominent and require the same number of clicks.
US-only sites: what actually applies
If your site serves only US visitors and has no EU or UK traffic, the ePrivacy Directive and GDPR do not apply. There is no US federal cookie consent requirement. However, two California-specific obligations are worth understanding:
CCPA/CPRA "sharing" opt-out: California's CPRA (effective 2023) created a right for California residents to opt out of the "sharing" of personal data for cross-context behavioral advertising. Using a Facebook Pixel, Google Ads remarketing tag, or similar advertising cookie that passes identifiers to an ad network likely qualifies as "sharing" even if you never receive payment for the data directly. If you use advertising cookies, you need a "Do Not Sell or Share My Personal Information" link in your footer that provides an opt-out mechanism — not a prior consent banner, but an ongoing opt-out right.
Analytics cookies without advertising: If your US-only site uses only analytics cookies (no advertising pixels) from a provider that does not sell the data, there is currently no US legal requirement for a consent banner or an opt-out link. A simple cookie disclosure in your privacy policy (what cookies you set, why, and how long they last) is sufficient.
The practical problem: Most public websites are accessible to EU and UK visitors, even if you never intended to serve them. A developer in Chicago with a tool indexed by Google can receive EU traffic within hours of launch. If you are not IP-blocking EU/UK access, the conservative and common approach is to implement a consent banner for all visitors.
What a compliant cookie banner must contain
A banner that satisfies GDPR and ePrivacy requirements needs the following elements — in the banner itself, not buried in a linked policy:
One thing the banner does not need to contain: a list of every individual cookie name and duration. That level of detail belongs in the full cookie policy linked from the banner, not in the banner itself. The banner needs the category and purpose — the policy provides the inventory.
Generate a working cookie consent banner free with ComplyKit
ComplyKit generates a cookie consent banner from a short questionnaire — including the JavaScript that blocks non-essential scripts until the user consents, per-category toggles, a "Change preferences" footer link, and consent preference storage. It runs entirely in your browser; no data is sent anywhere.
The generated banner handles the three requirements that most template banners skip: (1) non-essential scripts are not loaded until consent is given, not just after; (2) Accept All and Reject All are at equal visual weight; (3) a preferences link is included for every page so users can withdraw consent without clearing cookies manually.
Generate my cookie consent banner free →
Frequently asked questions
Do I need consent for Google Analytics cookies?
Yes, if your site is accessible to EU or UK visitors. Google Analytics sets cookies that collect IP addresses and device identifiers — these qualify as personal data under GDPR. The ePrivacy Directive requires prior informed consent before setting any non-essential cookie on a device in the EU or UK, and Google Analytics is not essential to the service your users are there to use. Google's own guidance for EU users explicitly requires a consent banner and recommends implementing Consent Mode so analytics data is not processed for users who decline.
What counts as a "strictly necessary" cookie that doesn't need consent?
A cookie is strictly necessary only if the site cannot deliver the service the user explicitly requested without it. Session cookies that maintain a login state, shopping cart cookies, CSRF security tokens, and load-balancing cookies qualify. Analytics, advertising, heatmap tools, social media embeds, and A/B testing cookies do not — they serve the site owner's purposes, not the user's requested service. When in doubt, apply this test: if you removed the cookie, could the user still complete what they came to do? If yes, it's not essential.
Does "implied consent" — scrolling, clicking elsewhere, continued use — work under GDPR?
No. GDPR requires consent to be an unambiguous indication of the data subject's wishes through a statement or clear affirmative action. The European Data Protection Board's Guidelines 05/2020 on Consent explicitly state that "scrolling or swiping through a webpage or similar user activity will not under any circumstances satisfy the requirement of a clear and affirmative action." The ICO and CNIL have taken the same position. Continued use of the site, closing a tab, or scrolling past a banner are not affirmative actions and do not constitute valid consent under any EU or UK framework.
Is a "This site uses cookies" notice with a single button enough?
No. A notice-only banner with a single "Got it" or "Close" button, while loading non-essential cookies on page load, does not satisfy ePrivacy or GDPR requirements. The user must have a genuine choice — Accept and Reject — before non-essential cookies fire. A banner that only informs, while the cookies are already running, is non-compliant regardless of the wording. The ICO, CNIL, and German supervisory authorities have fined this implementation pattern specifically.
Do I need a cookie banner if all my visitors are from the United States?
There is no US federal cookie consent requirement. If your site truly serves only US visitors and uses no advertising cookies, a banner is not legally required — a disclosure in your privacy policy about cookies you set is sufficient. However, if you use advertising pixels (Facebook Pixel, Google Ads remarketing), California's CPRA requires a "Do Not Sell or Share My Personal Information" opt-out link for California residents. And in practice, most public websites indexed by Google are accessible to EU visitors, so truly US-only traffic is harder to guarantee than it sounds.
Can I use a cookie wall — only letting users in if they accept cookies?
No, not if you're serving EU or UK visitors. GDPR requires consent to be freely given, and the EDPB has stated clearly that access conditioned entirely on accepting non-essential cookies is not freely given. The European Court of Justice confirmed this principle in Planet49 (C-673/17). A cookie wall that says "accept cookies to continue" with no alternative — no paid option, no cookie-free version — is non-compliant in the EU and UK. The CNIL has fined this pattern in France; other EU regulators have followed.
Does GDPR apply to cookies if my company is not based in Europe?
Yes. The ePrivacy Directive applies based on where the user's device is located. If your site sets a cookie on a device in the EU, consent rules apply — regardless of where your server or company is. GDPR applies based on where your data subjects are: if EU residents use your service, GDPR governs how their personal data is processed. A developer in Canada or Australia whose tool is indexed by Google and served globally owes ePrivacy and GDPR obligations for EU traffic. The only reliable way around this is IP-blocking EU access, which is rarely practical or desirable.
Also in the Copper Bay Labs ship-safety suite
Cookie consent is one piece of a pre-launch compliance checklist. These free tools cover the other gaps — security headers, exposed secrets, accessibility, and privacy policies:
Checks your live site for accessibility and privacy-law gaps that attract ADA demand letters.
Security headers HardenCheckScan your live site's HTTP headers for missing CSP, HSTS, and other security hardening flags.
Secret scanning LeakCheckPaste code or a config file to find exposed API keys and tokens before they reach the repo.
Post-deploy ExposureCheckScan your live URL for exposed .env files, .git directories, and bundled secrets.