cookie consent for Bolt

Cookie consent for Bolt,
in one prompt

Bolt writes the analytics and pixel scripts you describe and never asks the visitor first. One prompt puts the CookieCrumbs tag in front of them and gates the rest.

The whole change: the runtime first, and every tracker turned into a script that waits for its category.

the rule

What Bolt ships without

A default Bolt project loads GA4 or a pixel on first paint. A banner component prompted later shows a choice, but cannot take back a script that has already run.

The rule is the same everywhere in the EU and the UK: nothing beyond what is strictly necessary may be stored on or read from a visitor’s device before they have agreed. That is Article 5(3) of the ePrivacy Directive, and the agreement has to meet the GDPR’s definition of consent: freely given, specific, informed and unambiguous, with a refusal that is as easy as the acceptance. The UK keeps the same rule in PECR, with narrow exemptions for low-risk statistics since 5 February 2026. California and the other US state laws work the other way round: no opt-in, but an opt-out link and support for the Global Privacy Control signal.

Three things follow for a website. Analytics, advertising and social scripts have to wait for a choice. The choice has to be recorded in a way you can show later, because Article 7(1) puts the burden of proof on you. And withdrawing has to be as easy as agreeing, which means a control that reopens the banner on every page. A banner that shows two buttons and loads Google Analytics anyway fails the first test, and that is the failure regulators have been fining, from the CNIL’s decisions against Google and SHEIN to the Dutch and Belgian authorities’ sweeps.

how it works

How consent works in a Bolt app

Bolt.new runs a full Node environment in the browser and can scaffold a Vite app, a Next.js app, an Astro site or plain HTML, then deploy to Netlify in one click. The place for the consent runtime depends on which one you chose: index.html for Vite and plain HTML, app/layout.tsx with next/script for Next.js, the integration for Astro. The prompt on this page covers the Vite and HTML case, which is what most Bolt projects are; the Next.js and Astro guides cover the others.

Bolt is good at following an exact instruction and bad at guessing what “compliant” means. Tell it where the tag goes and what to do with each tracker, and it does exactly that. Ask it for a compliant banner and it invents one that stores a flag and blocks nothing. The prompt is written to leave no room for guessing: first element of the head, then type="text/plain" with a category on every analytics, advertising and social script.

Once the app is deployed, the scanner reads it like a visitor, lists what still fires before consent, and the dashboard files each vendor once. A later Bolt session that adds a new tracker shows up in the next scheduled scan as an alert, blocked by default until you file it.

set-up

Set it up from Bolt

Ten minutes, one prompt, no npm.

  1. Create the site, get the key

    Sign up, add the domain your app is published on, and copy the production key from Install. The free plan covers two domains.

  2. Paste this prompt into Bolt

    It puts the tag first and turns every tracker into a consent-gated script. Read the diff it makes; nothing else should change.

    Add this script tag as the very first element inside <head> of index.html:
    <script src="https://app.cookiecrumbs.eu/runtime/cc.js"
            data-cc-site="pk_live_…"
            data-cc-env="production"></script>
    Then change every analytics, advertising and social script (Google Analytics, gtag, Meta Pixel, TikTok, Hotjar, HubSpot) to type="text/plain" and add data-cc-category="analytics" or data-cc-category="marketing" to each one. Do not change anything else.
  3. Publish, then scan

    Publish the app. In the dashboard, run the first scan: it loads the live app in a real browser and lists what still fires before consent, if anything.

  4. Sort once, set the legal links, publish the banner

    File each vendor under a category, set your imprint and privacy links, publish. The banner is live and the consent log is recording.

  5. Run the install check

    It loads your page like a visitor and confirms the banner ran before any tracker. That tick is the proof.

watch out

Mistakes we see with Bolt

Each one shows up in the first scan as a tracker that fired before consent.

  • Letting Bolt “make it GDPR compliant”It writes a banner and a flag. Give it the exact tag position and the exact script changes instead.
  • A Next.js project with the tag in index.htmlNext.js has no index.html. Use app/layout.tsx with strategy="beforeInteractive"; the v0 guide has the snippet.
  • Netlify deploy with the wrong keyPreview key on deploy previews, production key on the production site. The dashboard shows both.
  • A pixel added by an npm packagePackages that inject scripts at runtime are caught by the block map after the first scan; run it before you launch.
  • No imprint and privacy linksPublishing the banner is refused until both are set.

before you ship

The compliance checklist

Eight lines. The dashboard ticks the last two from real data.

  • The tag is the first script in the headAnything above it can set a cookie the runtime cannot take back.
  • Every analytics, ads and social script waits for its categoryEither type="text/plain" with a category, or the host is in the block map from the scan.
  • Reject all is on the first layerSame size, same weight as Accept all. No “X” that counts as consent, no pre-ticked boxes.
  • Consent Mode defaults are denied before Google loadsCheck the seven signals in Tag Assistant with consent denied.
  • The imprint and privacy policy links are setPublishing is refused until both are there; the banner footer links to them.
  • A withdraw control is reachable on every pageThe persistent control or a “Manage cookies” link in your footer.
  • The first full scan ran and every vendor is filedThe verdict on Home says what fired before consent, dated.
  • The install check passedIt loads your page like a visitor and confirms the banner ran before any tracker.

what you get

What you get on the free plan

Two domains, 100 subpages scanned a month per domain, every regulation, the CLI, the SDKs and the MCP server.

A scanner that reads the rendered page

Every page, in each consent state, in a real browser. Cookies, pixels, iframes and storage keys, with the page and script that set them. Re-scanned on a schedule.

The cookie declaration writes itself from the result.

A banner that blocks first

Tags stay inert until their category is granted. Reject all is as visible as Accept all. Seven layouts, 25 languages, Consent Mode v2, and the right rule per region.

21 kB, one file, no third-party requests of its own.

Proof you can hand over

Each choice is stored with a timestamp, the banner version and a hash of the texts shown, chained to the record before it. Exports are signed. Hosted in Frankfurt.

Article 7(1), on the free plan.

free check

See what your Bolt app loads right now

The homepage HTML, matched against the tracker database. No account, nothing stored. The full scan in the dashboard does the same for every page, in a real browser.

questions

Straight answers

Does Bolt add a GDPR cookie banner by default?
No. Bolt generates the analytics and pixel scripts you ask for and nothing that asks the visitor first. Asking it for a banner usually produces a cosmetic box that shows a choice and blocks nothing.
Which Bolt project types does this cover?
Vite and plain HTML with the prompt on this page. For a Next.js project use the v0 guide, for Astro the Astro guide; the tag is the same, only the file changes.
Is a cookie banner required for a small app?
If the app serves visitors in the EU or the UK and sets any non-essential cookie, analytics included, then yes. The duty sits with the operator of the site, not with the tool that generated it. A hobby project with no analytics and no embeds needs nothing.
Will the banner slow the app down?
The runtime is 21 kB gzipped, one file, loaded async, with no third-party requests of its own. The bar and ribbon layouts reserve their space before paint, so no layout shift.
Can I keep using the builder afterwards?
Yes. The tag and the gated scripts are ordinary HTML that Bolt preserves between edits. Re-run the scan after big changes; the dashboard alerts you when a new tracker appears.
Where does the consent data go?
To Frankfurt, Germany. Records never leave the EU, no IP address or user agent is stored beside a record, and every record exports as signed CSV or JSON, including after you cancel.

next step

Compliant before you share the link

Free plan, two domains, no card. Scan the live app first if you want to see what it loads today.