Webflow

CookieBoss works with Webflow out of the box. Add a single script tag to your project settings and your consent banner will appear on every page.

Step 1: Add the CookieBoss script

  1. In Webflow, go to Project Settings → Custom Code
  2. Paste the following into the Head Code section:
Webflow Head Code html
<script async src="https://cdn.cookieboss.io/scripts/YOUR_SITE_ID/consent.js"></script>
  1. Replace YOUR_SITE_ID with the Site ID from your CookieBoss dashboard (Settings → Installation)
  2. Click Save Changes, then Publish your site

Where to find your Site ID

Log in to your CookieBoss dashboard at app.cookieboss.io, go to Settings → Installation, and copy the Site ID shown in the script tag.

Step 2: Verify the installation

  1. Open your published Webflow site in an incognito/private window
  2. The CookieBoss consent banner should appear
  3. Open the browser console and run:
Console check js
console.log(window.CookieBoss)

If the script loaded correctly, this will log the CookieBoss API object.

If you use Google Analytics or Google Ads, add the Google Consent Mode snippet before the CookieBoss script in the Head Code section:

Webflow Head Code (with GCM) html
<!-- Google Consent Mode v2 defaults -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
  analytics_storage: 'denied',
  ad_storage: 'denied',
  ad_user_data: 'denied',
  ad_personalization: 'denied',
  wait_for_update: 500
});
</script>

<!-- CookieBoss (updates consent state automatically) -->
<script async src="https://cdn.cookieboss.io/scripts/YOUR_SITE_ID/consent.js"></script>

CookieBoss will automatically update the consent state when the visitor makes a choice. No additional configuration is needed.

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.

Blocked script example html
<!-- This script won't run until the visitor consents to "marketing" -->
<script type="text/plain" data-cookieboss-category="marketing"
src="https://example.com/pixel.js"></script>

Supported categories: necessary, functional, analytics, marketing.

Webflow native integrations

For integrations added through Webflow’s built-in settings (like Google Analytics), use the script-blocking approach above by adding them manually via Custom Code instead of through Webflow’s integration panel. This ensures CookieBoss can manage consent for those scripts.