Webflow
CookieBoss works with Webflow out of the box. Follow these five steps and your consent banner will appear on every page.
Step 1: Create a CookieBoss account
Sign up at cookieboss.io/signup. You can start with the free plan.
Step 2: Add your domain
In the CookieBoss dashboard at app.cookieboss.io, go to Sites → Add Site and enter your Webflow domain (e.g. mysite.webflow.io or your custom domain).
Step 3: Add the script to Webflow
- In Webflow, go to Project Settings → Custom Code
- Paste the following into the Head Code section:
<script src="https://cdn.cookieboss.io/scripts/YOUR_SITE_ID/consent.js" defer></script> - Replace
YOUR_SITE_IDwith the Site ID from your CookieBoss dashboard (Settings → Installation) - Click Save Changes
Head Code, not Body Code
The script must go in the Head Code section. Placing it in Body Code can cause the banner to flash or load late.
Step 4: Publish your Webflow site
Click Publish in Webflow so the script tag goes live on your site.
Step 5: Publish in CookieBoss
Back in the CookieBoss dashboard, go to your site and click Publish. This compiles your consent script with your banner settings, cookie categories, and language translations. The banner will not appear until you complete this step.
Where to find your Site ID
In the CookieBoss dashboard, go to Settings → Installation. The Site ID is shown in the script tag snippet.
Verify the installation
Open your published Webflow site in an incognito/private browser window. The consent banner should appear. You can also open the browser console and run:
console.log(window.CookieBoss) If the script loaded correctly, this logs the CookieBoss API object.
Block third-party scripts until consent
For scripts you add via Webflow’s Custom Code or Embed elements, change the type attribute to text/plain and add a data-cookieboss-category attribute. CookieBoss will activate them only after the visitor consents to that category.
<!-- This script won't run until the visitor consents to "analytics" -->
<script type="text/plain" data-cookieboss-category="analytics"
src="https://example.com/tracking.js"></script> Supported categories: necessary, functional, analytics, marketing.
Webflow native integrations
For integrations added through Webflow’s built-in settings (like Google Analytics), add them manually via Custom Code instead of through Webflow’s integration panel. This ensures CookieBoss can manage consent for those scripts.
Google Consent Mode v2
CookieBoss supports Google Consent Mode v2 automatically. When a visitor makes a consent choice, CookieBoss updates the Google consent state (analytics_storage, ad_storage, ad_user_data, ad_personalization) without any extra configuration on your part.
No additional script snippets are needed in Webflow.
Content Security Policy (CSP)
If your site sends Content-Security-Policy headers, add the CookieBoss domains so the script can load and send analytics:
| Directive | Domain | Purpose |
|---|---|---|
script-src | cdn.cookieboss.io | Loads the consent script |
connect-src | a.cookieboss.io | Sends consent analytics |
See the full CSP configuration guide for examples.
Troubleshooting
Banner not showing
- Check that you clicked Publish in both Webflow and the CookieBoss dashboard. Both are required.
- Make sure the script is in the Head Code section, not Body Code.
- Open an incognito window — if you already dismissed the banner, your consent is stored in a cookie.
Script returns 404
- The site has not been published in the CookieBoss dashboard yet. Go to your site in the dashboard and click Publish.
- Double-check that
YOUR_SITE_IDin the script tag matches the Site ID shown in Settings → Installation.
Banner flashes or loads late
- Move the script from Body Code to Head Code.
- Make sure no other scripts are blocking page load before CookieBoss.