Platform guides
Cookie consent in Webflow: step-by-step
Webflow has no built-in cookie banner, so you add a consent tool's script in Site settings → Custom code → Head code. Then you hold back embeds, custom scripts and Webflow's own integrations until visitors agree.
- Plain English
- Written for website owners
- Free to read
On this page
- Where third-party code lives in a Webflow site
- Step 1: add the banner to the head code
- Step 2: block custom scripts until consent
- Step 3: handle embeds, videos and maps
- Step 4: move integrations out of Webflow's settings
- Step 5: connect Webflow Analyze and Optimize
- Choosing a consent tool for Webflow
- Test before you hand the site over
- Webflow cookie consent checklist
- Frequently asked questions
To add cookie consent to Webflow, paste your consent tool's script into Site settings → Custom code → Head code, publish, then make every non-essential script and embed wait for consent. Webflow has no native cookie banner, so the work is in the details: scripts in custom code fields, Code Embed elements, native video and map elements, the analytics fields in Webflow's integration settings, and Webflow's own Analyze and Optimize products. This guide covers each.
Webflow renames panels from time to time, so the menu names below may differ slightly in your workspace.
Where third-party code lives in a Webflow site
Before you add a banner, find every place where code or third-party content enters your site:
| Location | What it applies to | Typical contents |
|---|---|---|
| Site settings → Custom code → Head code | Every page, in the <head> | Analytics, tag managers, consent banner |
| Site settings → Custom code → Footer code | Every page, before </body> | Chat widgets, pixels, helper scripts |
| Page settings → Custom code | One page or CMS template | Conversion tags, landing-page tools |
| Code Embed elements | Wherever placed in the Designer | Forms, calendars, iframes, widgets |
| Native Video and Map elements | Wherever placed | YouTube, Vimeo, Google Maps content |
| Site settings → Apps & integrations | Every page | Google Analytics and Facebook Pixel ID fields |
A cookie scan of your published site lists the cookies and third-party hosts that actually load, which makes it easy to spot anything you've forgotten.
Site-wide custom code requires a paid site plan, and custom code only runs on the published site, not in the Designer canvas.
Step 1: add the banner to the head code
- Open your project's Site settings and go to the Custom code tab.
- In Head code, paste the banner snippet at the very top, above any other scripts.
- Save changes.
- Publish the site to your domain and to the webflow.io subdomain if you use it.
<script src="https://cdn.privacyquick.com/v1/privacy.js" data-site-id="pq_xxxxxxxxxx" async></script>
Putting the banner first matters. Consent tools that set Google Consent Mode defaults need to run before Google tags, and a banner that blocks scripts must be on the page before they would run.
Webflow doesn't run custom scripts in the Designer. If the banner "doesn't appear", check the published site in a private window before you debug anything else.
Step 2: block custom scripts until consent
For every non-essential script in the head code, footer code or page settings, change the type to text/plain and add a category. The script won't download or run until the visitor allows that category:
<!-- Google Analytics 4, blocked until analytics consent -->
<script type="text/plain" data-category="analytics" async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script type="text/plain" data-category="analytics">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
If you'd rather keep Google tags loaded and let them adjust through Google Consent Mode, leave them untagged and rely on the consent signals instead. Our guide to GA4 and GDPR consent explains the trade-off. The script blocking docs have more examples, including the Meta Pixel and Hotjar.
Page-level code and CMS templates
Code in a page's settings only runs on that page, so it's easy to miss. Open the settings of each landing page and each CMS collection template and check the custom code fields. Conversion tags for ad campaigns often live here. CMS rich text fields can also contain embeds that editors added over time, so search your collections for iframes and scripts. Tag each one the same way, and remember that code on a CMS template runs on every item in that collection.
Step 3: handle embeds, videos and maps
Code Embed elements
Code Embed elements can hold scripts and iframes. Tag scripts the same way as above. For iframes, move the URL from src to data-src and add a category:
<iframe data-src="https://calendar.example.com/embed/your-team" data-category="functional"
width="100%" height="600" title="Book a call"></iframe>
<p>The booking calendar loads after you allow functional cookies.
<a href="#" onclick="window.PrivacyQuick && PrivacyQuick.open(); return false;">Cookie settings</a></p>
The short note helps visitors understand why the space is empty and how to fix it.
Native Video and Map elements
Webflow's built-in Video and Map elements generate their own markup, which you can't change to use data-src. If they load content that needs consent, replace them with a Code Embed containing a tagged iframe. For YouTube, the privacy-enhanced domain reduces but doesn't remove storage use. Our guide to YouTube embeds and cookies explains the details.
Background videos and Lottie files
Background videos and Lottie animations uploaded to Webflow are served as files from Webflow's asset hosting, not as third-party players. They normally don't need consent, but confirm with a scan.
Forms and spam protection
Native Webflow forms submit to Webflow and don't need a consent category to work. If you turned on reCAPTCHA in the form settings, Google's script loads on pages with forms and may use storage on the visitor's device. Whether spam protection counts as strictly necessary is debated, so decide deliberately, describe it in your cookie policy, and consider alternatives if you want to avoid the question. Third-party form tools added through Code Embeds should be tagged like any other embed.
Step 4: move integrations out of Webflow's settings
Webflow's Apps & integrations settings (named "Integrations" in older projects) offer fields for a Google Analytics ID and a Facebook Pixel ID. Webflow inserts those tags for you, which means you can't add type="text/plain" to them. They'll run before consent.
The fix is to clear those fields and add the same tags yourself in the head code, tagged with a category as in Step 2. If you use Google Tag Manager instead, load the container normally and configure consent checks inside GTM. PrivacyQuick sends Google Consent Mode signals without needing a CMP template, as described in the Consent Mode docs.
Step 5: connect Webflow Analyze and Optimize
Webflow's own analytics (Analyze) and testing and personalization (Optimize) products have a consent API. According to Webflow's developer documentation, inside wf.ready() you can call wf.allowUserTracking() or wf.denyUserTracking(), and read the current state with wf.getUserTrackingChoice(). Webflow's documentation also points to tracking settings for these products, so check how yours are configured.
To pass your banner's analytics choice to Webflow, add a bridge to the footer code:
<script>
document.addEventListener('pq:consent', function (e) {
var allowed = e.detail.categories.indexOf('analytics') > -1;
if (!window.wf || typeof wf.ready !== 'function') return;
wf.ready(function () {
if (allowed) {
wf.allowUserTracking();
} else {
wf.denyUserTracking();
}
});
});
</script>
This only matters if you use Analyze or Optimize. The wf object may not exist on sites that don't use them, so the check at the top keeps the code harmless there. If your cookie policy puts personalization under functional instead of analytics, change the category in the code to match. Check Webflow's current consent management documentation, since these APIs are newer and may change.
Choosing a consent tool for Webflow
Webflow sites commonly use one of three approaches:
- A hosted consent platform added through custom code, as above. It works the same way on Webflow and any other platform, which suits agencies with mixed client sites.
- Webflow-focused components or Webflow Apps marketplace apps, some of which let you design the banner in the Designer. Check how each one blocks scripts and whether it records consent.
- A custom-built banner. Possible with Webflow interactions and a bit of code, but you then own blocking, consent records, versioning, Consent Mode and regional rules. Our comparison of DIY banners vs consent platforms lists what you'd need to build.
Whatever you choose, confirm it blocks scripts before consent rather than only displaying a banner. The generic version of this setup is in our guide to adding a cookie banner to any HTML site.
Test before you hand the site over
- Publish, then open the live domain in a private window.
- With DevTools open, confirm the banner appears and no analytics, ad or embed requests fire before a choice.
- Reject all. Browse several pages, including CMS template pages with their own custom code.
- Open cookie settings, accept all, and confirm the tags and embeds load.
- If you use Analyze or Optimize, run
wf.getUserTrackingChoice()in the console after each choice. - Check both your custom domain and the webflow.io subdomain if both are published.
Webflow cookie consent checklist
- Banner script at the top of site-wide head code, and the site published.
- Every non-essential script in head, footer and page code is tagged with a category.
- Iframes in Code Embeds use
data-src; native Video and Map elements are replaced where needed. - Google Analytics and Facebook Pixel ID fields are cleared, with tagged code added manually instead.
- Analyze and Optimize follow the visitor's choice.
- A footer "Cookie settings" link or floating button lets visitors change their mind, and your cookie policy lists what you use. PrivacyQuick's policy generator can embed one on a Webflow page.
Frequently asked questions
Does Webflow have a built-in cookie banner?
No. Webflow doesn't include a cookie consent banner, so you need a third-party consent tool, an app from the Webflow Apps marketplace or a custom-built banner.
Can I add custom code on a free Webflow plan?
Site-wide custom code in the head and footer requires a paid site plan, and code only runs on the published site. Check Webflow's current plan details for your account.
Why doesn't my cookie banner show in the Webflow Designer?
Webflow doesn't run custom scripts in the Designer canvas. Publish the site and test on the live or webflow.io URL instead.
Does Webflow Analyze need cookie consent?
If Analyze sets cookies or similar identifiers on visitors' devices and you have EU or UK visitors, consent rules generally apply. Webflow provides consent APIs to allow or deny its tracking per visitor, which you can connect to your banner.
Check your own website in 30 seconds
Our free scanner lists every cookie and tracker your site sets, sorted into categories, before you add a banner.
This guide is general information, not legal advice. Laws and regulator guidance change; check the current rules for your situation or ask a lawyer.