Consentio

Cookie banner for Astro

Comply with GDPR and Google Consent Mode v2 on your Astro site with a banner that really blocks scripts before consent and won't slow your site down.

Astro renders static HTML with interactive islands, but that same architecture makes a load-order mistake easy: if the CMP snippet doesn't have is:inline, Astro treats it as a module and defers it. The result is gtag.js or GTM can run before Consent Mode v2 defaults to «denied».

What almost nobody tells you: The most common Astro mistake: without is:inline, Astro runs the script through its Vite pipeline and defers it, so the banner can load after Analytics has already set cookies.

How to install it on Astro

  1. 1. Create your free account (Free plan, 1 site) at signup — no card required. Start free →
  2. 2. Open the dashboard, create your site and copy the snippet with your siteKey.
  3. 3. Paste the snippet with the is:inline attribute inside <head> in src/layouts/Layout.astro, as the first script — before GA4, GTM or any pixel.
  4. 4. Open the site in incognito, reject cookies and check in DevTools that there are no _ga / pixels before accept.
  5. 5. Done! The banner appears and Consent Mode v2 is active automatically. Need more sites or logs? Upgrade to Pro (€9/mo).

Using Google Tag Manager?

Import our official template and fire it with the "Consent Initialization" trigger.

⬇ Download GTM template

Common mistakes with cookies on Astro

Why Consentio and not just any free plugin

Guides for other platforms

Keep exploring

Frequently asked questions

Why do I need is:inline in Astro?

Without it, Astro runs the script through Vite and defers it; the banner can arrive late and let tags through before consent.

Where exactly do I put the snippet?

In src/layouts/Layout.astro, inside <head>, as the first script — before any analytics or ads integration.

Does it work with Astro islands?

Yes: the banner lives in the shared layout, not an island, so it runs on every page without depending on hydration.

How much does a CMP cost on Astro?

Consentio Free (1 domain) or Pro €9/mo flat. /banner-cookies/astro · /registro?plan=pro

Get the next step by email

No spam. We'll send the link to create your free banner.

Get your Astro site compliant in 5 minutes

Create your free banner, no card needed.

Free for 1 domain · No card · Pro from €9/month

See pricing · Free GDPR checklist