Cookie consent for Webflow

Webflow lets you add code to the <head> of every page from the site settings. That's all the banner needs. Analytics you add the same way can be held back until the visitor agrees.

Set it up with your AI agent

Connect the Croombit MCP server to your editor or coding agent and paste this. It creates the site, the cookie categories and the banner, and edits your code.

Using Croombit: create a site for this project with Analytics (ANALYTICS) and Advertising (MARKETING) cookie categories, off by default, publish them and publish the banner. Create a TEST publishable key for localhost:3000. We use Webflow: give me the exact snippets to paste into Site settings → Custom code → Head code, with our analytics tags already set to type="text/plain" and data-tc-consent.

The agent works in TEST. Going live takes two steps in the console: verify your domain and swap in a LIVE key — see going live.

Or by hand

1. Site settings → Custom code → Head code

Paste the tag at the top of Head code, publish, and it's on every page.

<script src="https://croombit.com/cmp.js"
        data-tc-api-key="pk_live_…"></script>

2. Add analytics through Custom code too

Webflow's built-in integrations insert their tags on their own terms. To hold Google Analytics back until consent, remove its ID from Integrations and paste the tagged snippet under the banner instead:

<script type="text/plain" data-tc-consent="analytics" async
        src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script>
<script type="text/plain" data-tc-consent="analytics">
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXX');
</script>

Add an Embed element on your cookie policy page, and another in the footer symbol:

<div data-tc-cookie-declaration></div>
<a href="#" data-tc-open-preferences>Cookie settings</a>

Questions

Which Webflow plan do I need?

One that allows custom code in the site settings. Custom code only runs on the published site, not in the Designer.

Does it work with Webflow's staging domain?

Yes, with a TEST key whose allowlist includes your webflow.io domain. Switch to the LIVE key on your verified domain.