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
- In Webflow, go to Project Settings → Custom Code
- Paste the following into the Head Code section:
<script async src="https://cdn.cookieboss.io/scripts/YOUR_SITE_ID/consent.js"></script> - Replace
YOUR_SITE_IDwith the Site ID from your CookieBoss dashboard (Settings → Installation) - 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
- Open your published Webflow site in an incognito/private window
- The CookieBoss consent banner should appear
- Open the browser console and run:
console.log(window.CookieBoss) If the script loaded correctly, this will log the CookieBoss API object.
Optional: Google Consent Mode
If you use Google Analytics or Google Ads, add the Google Consent Mode snippet before the CookieBoss script in the Head Code section:
<!-- 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.
Optional: 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 "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.