Cookie consent for any website
Static HTML, a server-rendered app (Rails, Laravel, Django, Express), or a site builder that lets you edit <head>: the banner is one script tag. It blocks trackers until the visitor chooses, records every decision with proof, and sends Google Consent Mode v2 signals.
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. Add the Croombit script tag first in <head> of every page, and change our analytics and ad <script> tags to type="text/plain" with data-tc-consent set to their category.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. Add the tag first in <head>
Before any analytics or marketing tag, so it can hold them back. Use a pk_test_… key while you develop and the pk_live_… key once your domain is verified.
<script src="https://croombit.com/cmp.js"
data-tc-api-key="pk_live_…"></script>2. Hold back your trackers
Change type to text/plain and add data-tc-consent with the category. The tag stays inert until the visitor grants that category, then runs as normal. Well-known hosts (Google, Meta, Hotjar, Clarity…) inserted by JavaScript are also caught automatically, but tagging is the guarantee.
<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>denied defaults before they load, and an update the moment the visitor decides.3. Let visitors change their choice
Add a link anywhere — usually the footer. It reopens the panel with their current choices already set.
<a href="#" data-tc-open-preferences>Cookie settings</a>4. Publish the cookie list
On your cookie policy page, this fills itself with every cookie the scanner found, grouped by category, with the last scan date.
<div data-tc-cookie-declaration></div>Questions
Does it work with a site builder?
Yes, if it lets you add code to <head> on every page. Paste the tag there, as high as the builder allows.
Do I need a developer to keep the cookie list current?
No. Run a scan from the console, or schedule one; the declaration table updates from the latest scan.