Every site running analytics, advertising or embedded media sets cookies, and across the EU and UK non-essential cookies cannot load before a user says yes. A clear cookie policy plus a working consent banner is how you stay on the right side of the ePrivacy rules and GDPR. Here is how to do it properly.
The four types of cookies
| Type | Examples | Consent required |
|---|---|---|
| Strictly necessary | Login session, shopping cart, security tokens, load balancing | No |
| Preferences | Language, region, theme, recently viewed items | Yes, usually |
| Statistics | Analytics tools, heatmaps, performance monitoring | Yes |
| Marketing | Ad pixels, retargeting, embedded social media | Yes |
Only the first category may be set without consent, and it must be genuinely necessary for the service the user requested. Assume consent is needed for anything that merely improves your experience of the site.
What valid consent actually requires
- Freely given — refusing must be as easy as accepting, with no consent wall around basic content.
- Specific and informed — name each purpose and processor rather than asking for one blanket approval.
- Unambiguous — an affirmative action; no pre-ticked boxes and no consent implied from continued browsing.
- Withdrawable — an equally simple way to change the choice at any time.
UK PECR and the EU ePrivacy Directive layer on top of GDPR, while US state laws and browser opt-out signals such as Global Privacy Control require you to honour do-not-sell or do-not-share requests.
Designing an opt-in banner
- Block non-essential scripts until the banner is answered, not after the page has already fired analytics.
- Show three equal buttons: Accept all, Reject all, Manage preferences. Never bury reject on a second screen.
- In preferences, group cookies by purpose with toggles that start in the off position.
- Record the consent event — date, banner version and choice — so you can demonstrate compliance.
- Add a permanent footer link that reopens the preferences.
Auditing third-party cookies
Most sites do not know everything running on them. Open your browser developer tools, inspect the Application or Storage tab on every key page, and list each cookie with its domain, lifetime and purpose. Common surprises include embedded video players setting advertising identifiers, social share buttons loading trackers, and tag managers quietly firing new tags. Confirm every entry appears in your published notice, delete scripts you no longer use, and rebuild the document with the Cookie Policy Generator. Link it from the broader data disclosures produced by the Privacy Policy Generator.
Note: This article is general information, not legal advice. Consent rules vary by country and by the tools you use, so obtain professional advice for your situation.
Frequently asked questions
Do I need a banner if I only run analytics? Yes. Statistics cookies require consent under EU and UK rules, so an analytics-only site still needs a banner with a working reject option.
How long does consent last? There is no fixed legal number; six to twelve months is common practice. Re-consent sooner if you add vendors or change purposes.
Can I avoid a banner entirely? Only by loading no non-essential cookies at all — first-party, cookieless measurement plus a policy that says so. Anything else needs a prompt.