Spiegazione

Consenso ai cookie e SEO: un banner danneggia il posizionamento?

Affronta la preoccupazione comune che i banner cookie danneggino la SEO. Copre impatto CLS, velocità di pagina, crawlabilità e come evitare cali di prestazioni.

Pubblicato il

Consenso ai cookie e SEO: un banner danneggia il posizionamento?

The question I get asked most often by marketing teams about to add a CMP: will it hurt our SEO? The honest answer is “it depends on how badly you implement it.” A well-built cookie banner has effectively zero SEO impact. A poorly built one can wreck your Core Web Vitals and tank your rankings.

This guide walks through the three SEO concerns (crawlability, layout shift, page speed), the actual numbers behind each, and how to avoid the implementation mistakes that cause real damage.

Concern 1: Crawlability

The persistent myth is that cookie banners block Googlebot from seeing your content. They don't, because Googlebot doesn't handle cookies the way a human browser does.

Googlebot ignores cookie banners completely. The crawler doesn't accept, reject, or interact with the banner — it just renders the page (using the same Chromium engine human browsers use) and indexes whatever's in the DOM. If your banner appears as an overlay on top of your content, Googlebot still sees the content underneath. If your banner pushes content down, Googlebot sees the pushed-down content.

Where this can go wrong is if your CMP hides your content until consent. Don't do that. The content needs to be in the DOM and visible to a renderer that hasn't clicked anything on the banner. If you make your real content conditional on consent, you've invented a problem Googlebot won't solve for you.

John Mueller from Google has confirmed this in various Office Hours over the years. The latest definitive statement I'm aware of is from a 2023 SEO Office Hours: cookie banners don't affect indexing as long as the underlying content is accessible without consent. Anything else is folk wisdom.

Concern 2: Cumulative Layout Shift (CLS)

CLS is part of Core Web Vitals and is a ranking factor since 2021. It measures how much your page's visible content shifts during load. A cookie banner that pops in from the bottom of the viewport after page render is a textbook CLS offender.

The fix is straightforward: render the banner in a way that doesn't shift other content.

  • Use fixed or absolute positioning. If the banner is positioned outside the document flow, it doesn't push other elements around. Most modern CMPs do this by default.
  • If the banner is a top or bottom bar, give it a stable height from the moment it renders. Don't animate the height in.
  • Avoid centred modal banners that appear after a delay. They're visually disruptive but don't cause CLS — the shift happens off-flow.

ConsentTrustee's default banner is a bottom-fixed bar with a fixed height, which keeps CLS at zero. Most modern CMPs (Cookiebot, CookieYes, OneTrust) follow similar patterns. The CLS issue mostly shows up in custom-rolled banners that get the positioning wrong.

Concern 3: Page speed and INP

Cookie banner scripts have to load before the banner can render, which means they contribute to your page's loading time. The metric you care about is Largest Contentful Paint (LCP) — how long until the largest visible element of the page renders.

A render-blocking CMP script adds to your LCP. A heavy CMP script also adds to Total Blocking Time (TBT) and can affect Interaction to Next Paint (INP), which became a Core Web Vitals ranking factor in March 2024, replacing First Input Delay (FID).

Script size matters more than people think. Some real numbers:

  • ConsentTrustee runtime: 13 KB minified + gzipped.
  • Cookiebot: roughly 80 KB depending on configured modules.
  • CookieYes: roughly 60 KB on the free tier, more on paid plans with extra features.
  • OneTrust: 200–400 KB depending on configuration and modules.
  • Klaro (open source): roughly 30 KB.

On a fast connection these differences barely matter for LCP. On a slow 3G connection (which Lighthouse uses for its mobile scores) the difference between 13 KB and 300 KB is the difference between LCP under 2.5s and LCP over 4s, which is the line between “good” and “poor” in Core Web Vitals.

For INP, the key thing is that the banner's JavaScript doesn't block the main thread. A CMP that renders synchronously and runs heavy logic during page load can add 100+ ms to INP on mid-range mobile devices. CMPs that defer their work to requestIdleCallback or use Web Workers have effectively zero INP impact.

The script loading pattern that's SEO-friendly

For your CMP's own script:

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

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

async is the right attribute. The script loads in parallel with HTML parsing and runs as soon as it's downloaded. defer would also work and waits until the DOM is parsed before running, which delays the banner slightly but reduces TBT. For most sites async is the better trade.

Don't put the CMP script in a render-blocking position without async or defer. A synchronous script in <head> halts page rendering until the script downloads and executes, which is exactly what hurts LCP.

The Bot exception (and why you probably don't need it)

Some teams ask about hiding the banner from Googlebot entirely using user-agent detection. It's technically possible: detect the User-Agent string contains “Googlebot”, skip the banner.

I don't recommend this. Googlebot already ignores the banner. Adding user-agent detection just adds complexity, and Google's position on bot-specific content is murky — the guidance against cloaking technically applies, even though showing/hiding a banner isn't the kind of cloaking they care about.

The exception is if your banner blocks rendering of the page (which it shouldn't — but if it does and you can't fix it). In that case, suppressing the banner for bots is a last resort.

Mobile usability

Google's mobile usability checks (now part of the broader Page Experience signal) flag pages where pop-ups or banners cover “a significant portion” of the viewport.

Cookie banners are explicitly allowed by Google's guidance as long as they're “easy to dismiss.” A bottom bar of normal height is fine. A full-screen modal that covers the page on mobile and requires three clicks to dismiss is not.

Specific things to avoid:

  • Full-screen overlays without a visible “Reject” or close path on mobile.
  • Banners that cover the page's main content area without an obvious dismissal.
  • Banners that re-appear on every page load even after the visitor has chosen (you should remember the choice with localStorage).

What I'd read next

For the underlying compliance you're trying to satisfy, GDPR Cookie Consent. For how the banner UX itself can affect conversion (which compounds with SEO), Banner Examples That Convert. And for the broader CMP comparison if you're still choosing one, Best CMPs Compared.