Guía de cumplimiento

Consentimiento de cookies según el RGPD: la guía completa

Todo lo que los propietarios de sitios deben saber sobre las reglas del RGPD para cookies — qué se exige, qué cuenta como consentimiento válido y cómo implementarlo correctamente.

Publicado el

Consentimiento de cookies según el RGPD: la guía completa

If your website has visitors from the EU, you need consent before setting non-essential cookies. That's the short version. The long version is what this guide is about, because the short version gets a lot of teams in trouble: they read it as “show a banner” and call it done.

Most cookie-related fines from European data protection authorities trace back to specific, fixable mistakes. Setting cookies before the visitor clicked anything. Pre-ticked boxes. A “Reject” button hidden two clicks deep. None of those are subtle. They're not edge cases. They show up over and over in CNIL and Datenschutzkonferenz decisions, and they're the first things a regulator looks for.

So this is a practical guide: what the law actually says, what a compliant banner looks like in 2026, and where teams keep tripping up.

GDPR doesn't really mention cookies

Confusingly, the cookie rules don't come from GDPR alone. They come from two laws working together.

The ePrivacy Directive (2002/58/EC) is the one that requires consent before you store or read information on a visitor's device. It applies to cookies, localStorage, fingerprinting, anything that touches the device. The only exception is for “strictly necessary” purposes: the session cookie that keeps a user logged in, the cart cookie on an e-commerce site, the CSRF token. That's roughly it.

GDPR is what defines what “valid consent” has to look like, and it kicks in whenever those cookies process personal data. They almost always do.

So a cookie banner that's GDPR-compliant but ePrivacy-violating is still illegal. A banner that's ePrivacy-compliant but ignores GDPR's consent definition is also illegal. Both have to be satisfied. Everyone says “GDPR cookies” because GDPR is the bigger brand name, but the real obligation is the combined one.

What “valid consent” actually means

The European Data Protection Board has been consistent on this since 2018. The requirements:

  1. Freely given. No pre-ticked boxes. No “accept or leave” walls (the EDPB shut down cookie walls in Guideline 05/2020, and rejected the “pay or okay” variant again in 2024). Consent can't be a condition of the service unless the cookies are genuinely needed to provide that service.
  2. Specific. One global “Accept all” is fine as a shortcut, but the visitor has to be able to opt in per purpose. Analytics yes, advertising no has to be a possible answer.
  3. Informed. Before the visitor decides, they need to see what's being set, by whom, and why.
  4. Unambiguous. A clear affirmative action. Closing the banner doesn't count. Scrolling doesn't count. “Continuing to use the site” doesn't count. The Court of Justice nailed this down in the 2019 Planet49 case (C-673/17) and the data protection authorities have been hammering it home since.
  5. Withdrawable. As easy to revoke as it was to give. The same banner that asked for consent needs a way to come back later: a footer link, a floating button, something visible.

That fifth one trips up more teams than the other four combined. Once your banner is dismissed, where can the visitor change their mind? If the answer is “they can't without clearing cookies,” you're not compliant.

The fines, briefly

It helps to look at the actual money to calibrate how seriously authorities take this. A non-exhaustive list, all from the CNIL in France because they've been the most active enforcer:

  • Google — €150M (December 2021), for not offering a one-click “Reject all” on google.fr and youtube.com.
  • Meta / Facebook — €60M (December 2021), same issue.
  • Amazon — €35M (December 2020), for dropping advertising cookies before consent.
  • TikTok — €5M (January 2023), again for the missing reject button.

The common thread is design, not technical complexity. None of these were caught by sophisticated tooling. They were caught by a regulator with a laptop pressing buttons.

The four categories everyone uses

Most consent management platforms, ours included, group cookies into four standard categories. This isn't required by law, but it's the de facto industry standard and what users now expect to see in a preferences modal:

CategoryNeeds consent?Examples
NecessaryNoSession, CSRF, load balancer, language preference
PreferencesYesTheme, layout, region selector, currency
StatisticsYesGoogle Analytics, Hotjar, Plausible (with cookies)
MarketingYesMeta Pixel, Google Ads, LinkedIn Insight Tag, retargeting

Worth saying clearly: a cookie is “necessary” only if removing it would break the service the visitor explicitly asked for. Analytics is useful. Analytics is not necessary. I see this miscategorisation constantly, and it's a cheap way to fail an audit.

What a compliant banner looks like in 2026

Four things have to be on the first screen the visitor sees:

  • A plain-language explanation of why cookies are used. Not “we value your privacy.” What the cookies actually do.
  • An Accept button and a Reject button of equal prominence. Same size, same colour, same depth. This is the part most teams get wrong, and the part the CNIL has been fining people over for five years.
  • A way to open granular preferences for visitors who want to allow some categories but not others.
  • A link to a cookie policy or declaration page listing every cookie, who sets it, and what it does.

Until the visitor makes a choice, none of the non-essential cookies fire. Including Google Analytics. Yes, even with IP anonymisation. The way most modern sites keep some analytics signal without breaking compliance is Google Consent Mode v2, which lets GA send cookieless pings so the data isn't completely dark while the cookies themselves wait for opt-in.

The mistakes I see over and over

Most cookie banners on the public internet are non-compliant in roughly the same ways. If you check your own and find any of these, you have a problem.

The banner appears but cookies are already set. Open DevTools, load the page in incognito, check the Application tab. If you see _ga or _fbp before you've clicked anything, the third-party tags are firing too early. The fix is either script blocking (modify the <script> tag so the browser doesn't execute it) or Consent Mode (let the tags load but tell them not to act). A CMP handles both.

Pre-ticked checkboxes in the preferences modal. Categories start unchecked. Planet49 settled this in 2019 and there's been a string of fines since.

“Accept” louder than “Reject.” Green button vs grey link, a giant “Accept all” vs a small “Customise”: regulators call this a dark pattern, and it invalidates consent. The CNIL's position is that the visual weight of both buttons has to be equivalent.

No way to withdraw. The banner is dismissed and there's no path back. If your only answer is “clear cookies,” you're failing requirement five from above.

No record of consent. You have to prove, per visitor and per timestamp, what they chose. Most CMPs handle this automatically, but if you're rolling your own, you need a consent log somewhere that survives audit.

There are subtler mistakes too: third-party iframes that set cookies behind your back, “essential” cookies that are actually analytics, banners that disappear before the visitor sees them on slow connections. The five above are the ones I'd check first.

How to actually implement it

Three things have to work together: a banner that captures the visitor's choice, a script-blocking layer that stops tags from firing until they're allowed, and a consent log so you can prove compliance later.

With ConsentTrustee, that's one script tag in your <head> plus a small change to how you load your tracking scripts:

<script
  src="https://cdn.consenttrustee.com/consenttrustee.js"
  data-domain="your-domain-slug"
  async
></script>

<!-- Tag scripts that need consent -->
<script
  type="text/plain"
  data-ct-category="statistics"
  src="https://www.googletagmanager.com/gtag/js?id=G-XXXXX"
></script>

Replace your-domain-slug with the slug from your ConsentTrustee dashboard, not your site's address.

The type="text/plain" keeps the browser from running the script. Our runtime swaps the type to text/javascript once the visitor accepts the matching category. Same trick works for Meta Pixel, Hotjar, anything you'd otherwise drop in directly. For tags managed inside Google Tag Manager, you'd wire consent at the trigger level instead, covered in the GTM guide.

What I'd read next

If you also serve US visitors, CCPA and the state laws work on a different model. Bolting a GDPR banner onto a CCPA site doesn't always work, and in a couple of states it's actively counterproductive. If you run Google Ads or GA4, Google Consent Mode v2 is now effectively mandatory for EU traffic. And when you want to ship, the five-minute integration guide walks the whole thing end to end.