Skip to content

Cookie consent

GDPR cookie categories, explained simply

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

Almost every cookie banner groups cookies into categories like "Necessary", "Analytics" and "Marketing". When you set up a banner, you decide which category each cookie belongs in, and that decides whether you need visitors' permission. Get it wrong and you either ask needless questions or, more often, hide tracking in "necessary", which is exactly what regulators look for.

The short version

Most cookie banners use four categories: strictly necessary (no consent needed), preferences, analytics and marketing (all three need consent in the EU). The GDPR doesn't define these categories; they come from the ePrivacy rules and regulators' guidance. The test: if a cookie isn't strictly needed to provide something the visitor asked for, it needs permission. The UK is the exception since February 2026: preferences and first-party statistics can run without consent if you explain them and let people object.

Words you'll see in this guide (4)
First-party cookie:
Set by the website you're visiting.
Third-party cookie:
Set by another company whose code runs on the site, such as Google, Meta or YouTube.
Consent:
A visitor's clear, active choice to allow a category. Silence, scrolling and pre-ticked boxes don't count.
ePrivacy Directive:
The EU law (Article 5(3)) requiring consent before storing or reading non-essential information on a device. The UK version is PECR.
On this page
  1. The four categories
  2. Strictly necessary
  3. Preferences
  4. Analytics
  5. Marketing
  6. Cookie lookup
  7. Tricky cases
  8. In your banner
  9. Questions
  10. Sources

The four cookie categories at a glance

CategoryWhat it's forExamplesConsent in the EU?Consent in the UK?
Strictly necessaryMaking the site work as the visitor expectsLogin session, shopping cart, security, load balancing, the consent cookieNoNo
Preferences (functional)Remembering choices to improve the experienceLanguage, region, dark mode, recently viewedYes, unless the visitor set it themselvesNo since Feb 2026, with notice and an opt-out
Analytics (statistics)Counting visits and understanding behaviourGoogle Analytics, Hotjar, Clarity, MatomoYes, except narrowly configured audience measurementNo for first-party statistics used only to improve your site; yes otherwise
Marketing (advertising)Showing and measuring ads, including on other sitesMeta Pixel, Google Ads, TikTok, LinkedIn Insight TagYesYes

Strictly necessary: the narrowest category

The exemption comes from Article 5(3) of the ePrivacy Directive: no consent is needed when storing information is strictly necessary to provide a service the visitor explicitly asked for. European regulators explained it in Opinion 04/2012, and they read it narrowly.

  • Yes: the cookie that keeps a shopping cart, keeps a user logged in, protects a form from spam, balances traffic between servers, or remembers the visitor's cookie choice.
  • No: analytics ("we need it to improve the site"), ad measurement ("we need it to pay for the site"), or anything useful to you rather than needed by the visitor.

A common mistake

An online shop puts Google Analytics in "Strictly necessary" because "we can't run the business without data". That's the most common mistake: analytics helps the business but isn't needed to deliver what the visitor asked for, so it needs consent.

Preferences: helpful but optional

Preferences cookies remember choices that make the site nicer but aren't essential, like a chosen language or a "recently viewed" list. In the EU, if the visitor actively sets a preference (for example, clicks a language switch), storing that choice can count as necessary for the feature they used. Remembering things automatically needs consent.

In the UK, cookies for a site's appearance or functionality no longer need consent since 5 February 2026, as long as you explain them and give a simple way to object.

Analytics: the category most sites get wrong

Standard setups of Google Analytics, Hotjar and Microsoft Clarity need consent in the EU. Two narrow exceptions exist:

  • France (and some other EU countries): the CNIL accepts audience measurement without consent if it's strictly limited: anonymous statistics only, for the site owner alone, no tracking across sites, no data passed to third parties, truncated IP addresses and trackers lasting at most 13 months. The CNIL says most large analytics products don't qualify.
  • UK: since 5 February 2026, analytics used only to understand and improve your own site can run without consent, if you tell people and offer an opt-out. Analytics shared with a third party for its own purposes still needs consent.

So don't assume a standard Google Analytics setup qualifies for either. For details, read is Google Analytics GDPR compliant?

Marketing: always needs consent

Advertising pixels and retargeting cookies follow people across websites to show and measure ads. They always need consent in the EU, the UK and India. In California and other US states they usually count as "sharing" personal information, which needs an opt-out link instead.

Common cookies and where they belong

Found a cookie name in your browser or a scan and not sure what it is? Typical defaults (lifetimes vary with configuration):

CookieSet byWhat it doesCategory
_ga, _ga_<ID>Google Analytics 4Distinguishes visitors and sessions; about 2 yearsAnalytics
_gidGoogle AnalyticsDistinguishes visitors for 24 hoursAnalytics
_gcl_auGoogle AdsLinks ad clicks to conversions; about 90 daysMarketing
IDE, test_cookieGoogle (DoubleClick)Ad targeting and measurement across sitesMarketing
_fbpMeta PixelIdentifies browsers for Facebook and Instagram ads; about 90 daysMarketing
_ttpTikTok PixelAd measurement and targetingMarketing
li_sugr, bcookieLinkedIn Insight TagAd measurement and targetingMarketing
_hjSessionUser_<ID>HotjarRecognises returning visitors for heatmaps and recordings; about 1 yearAnalytics
_clck, _clskMicrosoft ClaritySession recording and heatmapsAnalytics
YSC, VISITOR_INFO1_LIVEYouTube embedsCounts views and tracks preferences for embedded videosMarketing
__cf_bmCloudflareBot protection; about 30 minutesStrictly necessary
PHPSESSID, connect.sidYour own serverKeeps a session or login goingStrictly necessary
__stripe_mid, __stripe_sidStripeFraud prevention during paymentStrictly necessary

Tip: The free website check lists every cookie your site actually sets, and Kiescy's cookie scanner sorts them into categories automatically using a database of known cookies.

The tricky cases

ToolWhere it usually belongsWhy
Embedded YouTube or Vimeo videosMarketingThey set third-party cookies as soon as the page loads. Use youtube-nocookie.com embeds or a click-to-load placeholder
Live chat widgetsNecessary only once the visitor opens the chatLoading and tracking for everyone on page load needs consent
A/B testing toolsAnalyticsTesting designs helps you, not the visitor
Fraud and bot protectionStrictly necessaryWhen used only for security
Google Tag ManagerNone by itselfIt sets no cookies, but the tags it fires do; control those with consent
Social share buttons and feedsMarketingMany load tracking code from social networks
Google Maps embedsMarketing or preferencesThey set Google cookies on load; use a static map with click-to-load

Questions

Are analytics cookies strictly necessary?

No. Standard analytics needs consent in the EU. France allows narrowly configured anonymous audience measurement without it, and the UK exempts first-party statistics used only to improve your own site, with notice and an opt-out.

Does the cookie that stores consent need consent?

No. Remembering the visitor's choice is necessary to respect it.

How many categories should my banner have?

Three or four is typical. More is allowed, but too many choices make the banner harder to use.

Can I use legitimate interest instead of consent for analytics cookies?

Not for the cookie itself in the EU. The ePrivacy rules require consent for non-essential cookies whatever your GDPR legal basis. See legitimate interest vs consent.

Are functional cookies the same as preferences cookies?

Yes. Most banners use "functional" and "preferences" for the same category.

What is the _ga cookie?

It's the main Google Analytics cookie. It assigns a random ID to tell visitors apart and lasts about two years by default. It's an analytics cookie, so it needs consent in the EU.

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. Article 29 Working Party: Opinion 04/2012 on the cookie consent exemption
  3. CNIL: Use analytics on your websites and applications (sheet n°16)
  4. ICO: Guidance on the use of storage and access technologies

See which cookies your site sets

The free check lists every cookie and tracker your site loads, with its likely category. About 15 seconds.

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.