Platform guides

Webflow Consent Mode v2: how to set up Google Consent Mode on Webflow

Article contents

Google Consent Mode v2 is the channel through which Google tags learn what the visitor accepted. It carries four signals: ad_storage, analytics_storage, ad_user_data and ad_personalization. Since March 2024, Google requires the two newer signals for visitors in the European Economic Area if you want to keep remarketing, audiences and full conversion measurement in Google Ads. Our Google Consent Mode v2 implementation guide explains the mechanism in depth. This article covers what is specific to Webflow.

Consent Mode does not replace consent. Under the GDPR and the ePrivacy rules, analytics and advertising cookies still need a prior, free choice from the visitor. Consent Mode passes that choice to Google tags so they adapt their behaviour. It does nothing for non-Google scripts such as the Meta Pixel, Hotjar or a YouTube embed: those must be blocked by your consent banner itself.

Webflow adds one difficulty of its own. The platform does not block any script for you, and it offers several places where a Google tag can be added, some of which run before anything you paste in custom code.

Where Google tags come from on a Webflow site

Before configuring anything, list every source that can load gtag.js or Google Tag Manager:

  • Site settings → Apps & Integrations, where a Google Analytics Measurement ID can be entered. Webflow then injects its own GA loader.
  • Site settings → Custom code, in the Head code or Footer code fields.
  • Page settings → Custom code, which runs only on the page concerned.
  • Code Embed elements placed in pages, CMS templates or components.
  • A Google Tag Manager container pasted in Head code, which in turn loads GA4, Google Ads and other tags.
  • Apps from the Webflow Marketplace that add their own scripts.

The first source is the one that breaks Consent Mode most often, because it sits outside your control in the page order.

Step 1: list your tags and check your plan

Open Site settings → Custom code and copy the content of Head code and Footer code. Open Apps & Integrations and note any Google ID. Search the Designer for Code Embed elements. Then compare with what the published site actually loads: a scan shows the tags that other tags load in turn.

Site-wide custom code requires a paid site plan. On a free plan, you cannot paste a consent snippet in Head code, so plan the upgrade first.

Step 2: paste the consent stub and the banner at the top of Head code

Your consent snippet should contain two parts, in this order:

  1. an inline stub that declares gtag('consent', 'default', …) with the four signals set to denied;
  2. the loader of your consent banner, which later sends gtag('consent', 'update', …) when the visitor clicks.

Paste it at the very top of Site settings → Custom code → Head code, above Google Tag Manager, any gtag.js and any pixel. The stub must be inline: an external script loads asynchronously and can lose the race against a Google tag that loads faster. Site-level code also covers CMS templates and Ecommerce pages, which page-level code alone would miss.

A concrete example: the Webflow tab of FlowConsent's integration screen generates this snippet with the stub first, including wait_for_update, url_passthrough and ads_data_redaction, followed by the banner loader. You paste one block and the order is right by construction.

Step 3: remove the Measurement ID from Apps & Integrations

This is the Webflow trap. When a Google Analytics Measurement ID is set in Site settings → Apps & Integrations, Webflow injects its own GA loader above your custom code. Its gtag('config') command enters the dataLayer before your consent defaults, and Google processes it as if the visitor had never refused. Consent Mode defaults only apply to commands that come after them, so no consent banner can fix this from custom code.

The fix: delete the ID from that panel, then load Google Analytics from a place that runs after the stub (step 4).

Step 4: load GA4 and Google Ads after the defaults

You have two clean options:

  • Declare the Google services in your consent banner, which injects them only after consent, or in cookieless mode if you choose the advanced setup.
  • Load them from Google Tag Manager, with the GTM container pasted below the consent snippet in Head code. Google tags in GTM read the consent state automatically.

Avoid a third option that looks simpler: a gtag.js pasted in Footer code without any consent logic. It does follow the defaults, but it also escapes the banner's blocking for everything that is not a Google tag.

Step 5: choose basic or advanced mode

In basic mode, Google tags do not load at all until consent. In advanced mode, they load with denied signals and send cookieless pings after a refusal, which feeds Google's conversion modeling. Both are valid; the choice depends on how much you rely on Google Ads modeling. Our comparison of Consent Mode basic vs advanced details what each mode does to your data.

Step 6: publish

Custom code only ships when you publish. The Designer preview does not run it, so nothing you see in the Designer proves Consent Mode works.

Not sure what your Webflow site loads before consent today? Check it in 30 seconds with the free cookie scanner: it lists the cookies and trackers set before any choice.

Many Webflow sites run their tags through GTM. The rule does not change: the consent stub and the banner go above the GTM snippet in Head code, never inside GTM as a Custom HTML tag. Loaded from the container, the banner would arrive after the page has been parsed, too late to block scripts written directly in the page.

Inside GTM, Google tags (GA4, Google Ads, Floodlight) read the consent state on their own. Non-Google tags need consent checks or triggers that wait for the visitor's choice. GTM's Consent Overview lists every tag whose consent is not configured, which makes it easy to spot a forgotten one. Our Google Tag Manager and Consent Mode v2 guide walks through the triggers.

If you used to enter a GTM container ID in a Webflow app or integration field, check where that code lands in the page. If it lands above your snippet, remove it and paste the GTM snippet yourself, below the consent stub.

Webflow Analyze and Webflow Optimize are Webflow's own analytics and testing products, not Google tags. Consent Mode signals have no effect on them. Webflow documents a separate Browser API for this case: on sites where Analyze or Optimize is enabled, wf.denyUserTracking() and wf.allowUserTracking() switch tracking off or on for the current visitor, and wf.getUserTrackingChoice() returns the stored choice (allow, deny or none).

If you use either product on a site with EU visitors, check whether your consent banner calls these functions, and if not, call them from the banner's consent events. Treat this as a separate item on your checklist from Consent Mode.

Test on the custom domain, not the webflow.io staging subdomain, and always on the published site.

  1. Open a private window with the developer tools, on the Network tab. Load a page without touching the banner. In basic mode, no request should go to google-analytics.com or googleadservices.com. In advanced mode, you may see pings carrying gcs=G100 (all signals denied), but no _ga or _gcl_au cookie.
  2. Click Reject and browse a few pages, including a CMS template. Still no Google cookie.
  3. Clear the site data, click Accept all: the next hits should carry gcs=G111 and the cookies should appear.
  4. In Google Tag Assistant, the Consent tab of a Google tag should show Denied defaults before any tag, then an update after your click.
  5. In the browser console, type dataLayer and check that the consent default entry comes before any config entry.

Our guide on how to check that Google Consent Mode v2 is working details each test and how to read the gcs values.

  • A Measurement ID still in Apps & Integrations. GA runs before the defaults and sets cookies whatever the visitor chooses.
  • The stub placed in Footer code or below GTM. The config command reaches Google first.
  • The banner loaded through a GTM Custom HTML tag. Too late for prior blocking.
  • Two GA4 installations, one in GTM and one in custom code or a Marketplace app: double counting and two consent paths.
  • Testing in the Designer or on webflow.io only. Custom code and domain-specific behaviour differ there.
  • Testing only the Accept path. The refusal path is the one that has to hold legally.

For the rest of a Webflow site's compliance, from embeds to forms and the cookie policy, see our Webflow cookie consent guide.

FlowConsent has Google Consent Mode v2 built in. The Webflow tab of the integration screen generates a single snippet for Head code: an inline stub that sets the four signals to denied at parse time, then the banner, which sends the update as soon as the visitor chooses. GA4 and Google Ads are declared as services and load only after consent, and other scripts are blocked until the visitor agrees. At startup, the banner checks whether a Google config command came before the consent defaults and logs an explicit console error if so, which on Webflow almost always points to Apps & Integrations. Installation takes about ten minutes, the service is hosted in Europe, and it is free up to 25,000 sessions per month (Pro at €14.99 per month up to 100,000). The Webflow integration guide covers each step.

Questions

Common questions on this topic.

Can't find your question? Write to us, we answer fast.

Does Webflow handle Google Consent Mode v2 on its own?

No. Webflow hosts your site but does not manage consent for the tags you add. Consent Mode v2 signals come from your consent banner: a stub sets the four signals to denied before any Google tag, then the banner sends an update when the visitor chooses. If Google Analytics is connected through Apps & Integrations, Webflow loads it above your custom code, before those defaults.

Where do I put the Consent Mode code in Webflow?

At the very top of Site settings, Custom code, Head code, above Google Tag Manager, any gtag.js and any pixel. Site-level code runs on every page, including CMS templates and Ecommerce pages. The Consent Mode stub must be inline and come before the banner loader. Then publish the site: the Designer preview does not run custom code, so test on the published custom domain.

Why does Google Analytics still set cookies after a refusal on Webflow?

Usually because a Measurement ID is still entered in Apps & Integrations. Webflow then injects its own GA loader above your custom code, so the config command reaches the dataLayer before the denied defaults and Google processes it without restriction. Remove the ID from that panel and load GA4 through your consent banner or through Google Tag Manager placed below the consent snippet.

Do I need Google Tag Manager for Consent Mode v2 on Webflow?

No. A consent banner that sets the defaults and injects GA4 and Google Ads after consent is enough. GTM is useful if you already manage many tags there. In that case, keep the consent stub and the banner above the GTM snippet in Head code, never inside GTM as a Custom HTML tag, and configure consent checks for the non-Google tags in your container.

Does Consent Mode v2 control Webflow Analyze and Optimize?

No. Webflow Analyze and Optimize are Webflow products, not Google tags, so Consent Mode signals do not reach them. Webflow documents a separate Browser API for these products: wf.denyUserTracking() and wf.allowUserTracking() switch tracking off or on for the current visitor, and wf.getUserTrackingChoice() returns the stored choice. Check whether your consent banner calls these functions, or call them from its consent events.

Make your site compliant today.

Free up to 25,000 sessions a month. No credit card, no commitment.