How to add a cookie banner to Webflow
A GDPR-friendly cookie banner for your Webflow site in about five minutes, with FrostBanner's free plan.
If your Webflow site uses Google Analytics, Meta Pixel, YouTube or Google Maps and has visitors from the EU, you need to ask before those load. Here's how to do it with one line of code.
Before you start: Webflow only runs site-wide custom code on sites with a paid Site plan, or in a Core, Growth, Agency or Freelancer Workspace. Custom code also appears only on the published site, not in the Designer.
1. Create your banner
- Sign in to FrostBanner with Google, GitHub or your email.
- Add your website's domain.
- Pick a style, write your texts and paste the link to your cookie policy. The preview shows exactly what visitors will see.
- Open the Install tab and copy your line of code. It looks like this:
<script src="https://app.frostbanner.com/v1/fb.js" data-site="YOUR_SITE_ID"></script>
2. Paste it into Webflow
- In Webflow, open Site settings → Custom code.
- Paste the line at the very top of Head code, above any analytics or tracking code.
- Click Save changes, then Publish your site.
Open your published site in a private window. The banner should appear.
3. Make tracking wait for consent
A banner on its own doesn't block anything. Change each tracking script in Head code so it only runs after the visitor accepts its category. For Google Analytics, change:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
to:
<script type="text/plain" data-category="analytics" async
src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
Use analytics for statistics, marketing for ad pixels such as Meta Pixel, and functional for extras such as chat widgets. Do the same for the inline script that comes with each tag.
4. Block YouTube videos and Google Maps
Webflow's built-in video element loads YouTube straight away. To block it until consent, use an Embed element instead and rename src to data-src:
<iframe width="560" height="315" data-category="marketing"
data-src="https://www.youtube-nocookie.com/embed/VIDEO_ID" allowfullscreen></iframe>
Until the visitor accepts, they see a small notice with an “Allow and show” button. Google Maps embeds work the same way.
5. Check it works
- Open the published site in a private window and click Reject all. In the browser's developer tools (Network tab), Google Analytics requests should not appear.
- Click the small button to reopen preferences, accept Analytics, and the requests should start.
- Your consent log in the FrostBanner dashboard shows each decision.
Things to know
- FrostBanner sends Google Consent Mode v2 signals, so Google tags know what the visitor chose.
- If you earn from Google AdSense with visitors from the EU, personalized ads need a Google-certified platform with IAB TCF. FrostBanner doesn't have it yet, so Google would show only non-personalized or limited ads.
- You still need a cookie policy page that lists the cookies your site uses.
Add your Webflow cookie banner now. The free plan covers one website, with no page or pageview limit.
Webflow is a trademark of Webflow, Inc. FrostBanner is not affiliated with Webflow. Webflow plan requirements are from Webflow's help centre, checked on 1 November 2026. FrostBanner does not give legal advice.