Integrations
WFWebflow
implementation guidePlatforms and stores

Cookie banner for Webflow with Google Consent Mode v2

Add the CookiePilot banner to a Webflow site with Custom code in Site settings. You paste the CookiePilot code at the top of the Head code field and Google Analytics and GTM below it, so Consent Mode v2 sets denied before the tags you paste below it run.

Consent behaviour

You paste the code once in Site settings → Custom code and it runs on every page of the published site.

You control the order in the Head code field: CookiePilot at the top, GA4, GTM and other tags below it.

The banner only loads on the domain added in CookiePilot, so the published site's domain must match it.

Setup steps

In the CookiePilot panel, add the site's domain (custom or the .webflow.io address) and copy the install code.

In Webflow, open Site settings → Custom code and paste the code at the very top of the Head code field, before any other script.

Paste Google Analytics and GTM into the same field below the CookiePilot code. Leave the Google Analytics field in Site settings → Integrations empty, so the tag does not load twice and outside your control of the order.

Save and publish the site. Custom code needs a paid site plan or a workspace plan that includes custom code.

Open the published site in a private window and check it using the checklist.

To remove the banner, delete the code from Head code and publish again.

Platform limitations

Webflow Analyze and Optimize have their own consent API (the wf.* functions). CookiePilot does not call it, so if you use those tools, pass the decision to them with your own code.

Webflow does not document the order of the native Google Analytics integration relative to Head code. That is why we recommend GA in Head code below CookiePilot.

We have not verified whether Head code runs on Webflow Ecommerce checkout pages. Check the banner on the cart, at checkout and on /order-confirmation.

Example snippet

Example snippet
<script src="https://cdn.cookiepilot.io/stub.js"></script>
<script async src="https://cdn.cookiepilot.io/cookiepilot.js" data-cpkey="YOUR_SITE_KEY"></script>

Test checklist

In the page source, stub.js is the first script from Head code, before gtag.js and gtm.js.

The first dataLayer entry is consent default with denied values.

Before the visitor clicks there are no _ga, _gcl or _fbp cookies.

After Accept, dataLayer contains consent update granted and GA4 sends page_view.

Related integrations

See the setups that most often appear together with this integration.

Ready to configure it?

Start CookiePilot, choose the right integration and verify that tags wait for user consent before they run.