Using ConsentBit with Google tag gateway

October 1, 2026

What Google tag gateway is, how it affects consent, how to check whether your tags use it, and what to do if ConsentBit's debug mode reports a late consent signal.

What Google tag gateway is

Google tag gateway for advertisers lets you deploy a Google tag using your own first-party infrastructure, hosted on your website's domain. Your website loads the Google tag from your own domain, and some measurement requests are sent to Google through your domain.

You can set it up in three ways: through your CDN (for example Cloudflare or Akamai), through Google Cloud Load Balancer, or manually on your own server.

Google's documentation:

How Google tag gateway affects consent

Google tag gateway changes where your Google tag loads from. It does not change how consent works. Google's consent mode still needs the consent default to be set before any Google tag fires. If a tag fires first, Google says it behaves as if consent mode is not in use.

ConsentBit sets that default as soon as its script loads. So on a page with Google tag gateway, the ConsentBit script must still run before the Google tag.

Automated (one-click) CDN setup and load order

Some CDNs offer an automated, one-click setup. The CDN then adds the Google tag to your pages itself. Google's Cloudflare guide says: "When automated set up is active, the platform inserts the new scripts into your HTML when there are no tags on your pages."

With automated setup, you usually cannot control where the Google tag is placed on the page, so you cannot make sure ConsentBit loads before it. The Google tag may then fire before the consent default is set. Google's guidance is: "If you use consent mode, you must turn off automated script set up."

Google tag gateway also changes the address your Google tag loads from. If you block Google tags until consent (basic consent mode), a tag served from your own domain may no longer be recognised and held back by its usual address.

Check whether your tag uses Google tag gateway

Use any of these checks:

  1. Google Tag Assistant (Google's method). Open tagassistant.google.com and connect your site. In Summary → Output → Hits Sent, check where the hits go. If they are sent to a path on your own domain (your "measurement path"), rather than to a Google domain such as google-analytics.com, the tag uses Google tag gateway.
  2. Your browser's network panel. Open your site, press F12, go to the Network tab and reload. Search for gtag/js or gtm.js. If the file loads from your own domain, for example https://www.example.com/abcd/gtag/js?id=G-…, instead of https://www.googletagmanager.com/…, the tag uses Google tag gateway.
  3. Your CDN or Google account. Check whether Google tag gateway is turned on in your CDN dashboard (for example Cloudflare's Google tag gateway setting), or in the Google tag settings in Google Ads, Google Analytics or Google Tag Manager.

Check the network panel, not the page source. Google notes that with a CDN setup, your original files can still point to googletagmanager.com while the tag is actually served through the gateway.

If debug mode flags a late consent signal

If ConsentBit debug mode reports a Google tag that loads before the consent default, and the checks above show the tag uses Google tag gateway, use one or more of the options below.

Option 1 (recommended): use advanced consent mode (U+C)

Advanced consent mode is the recommended setup for Google tags that use Google tag gateway, because it works with a manual Google tag gateway setup. In advanced consent mode, Google tags load straight away and follow the consent signals ConsentBit sends. It does not rely on blocking the Google tag by its address, which Google tag gateway changes.

Advanced consent mode is ConsentBit's default. See Google Consent Mode v2 for how to set it up, and make sure you have not blocked your Google tag with type="text/plain".

Then, according to your needs, turn on these settings in your Google tag settings (in Google Ads, Google Analytics or Google Tag Manager). They apply even if the Google tag fires before ConsentBit:

  • Data transmission controls: limit or stop the advertising, analytics and diagnostics data your Google tags send until consent is granted. See Google's Data transmission controls.
  • Global consent defaults ("Set consent mode override"): set the default consent state to denied for the regions you choose, from your Google tag settings instead of from your page code. See Google's Configure your Google tag settings.

ConsentBit then sends each visitor's choice as a consent update, as usual.

Option 2: move your tags into Google Tag Manager and serve it through Google tag gateway

  1. Move all your Google tags (Google Analytics, Google Ads, Floodlight) into one Google Tag Manager container.
  2. Add the ConsentBit CMP tag template to the container with the Consent Initialization - All Pages trigger. It sets the consent default before any other tag in the container fires. Don't also paste the ConsentBit script into your page.
  3. Deploy the container through Google tag gateway. See Google's Set up Google tag gateway for advertisers in Google Tag Manager with Cloudflare.

Option 3: set up Google tag gateway manually and control the script order

  1. Turn off automated script setup in your CDN.
  2. Add the Google tag to your pages yourself, loaded from your gateway path, below the ConsentBit script.

<head>
 <!-- 1. ConsentBit: first -->
 <script id="consentbit" src="https://manager.consentbit.com/consentbit/YOUR-SCRIPT-ID/script.js"></script>

 <!-- 2. Google tag, served through Google tag gateway on your own domain -->
 <script async src="https://www.example.com/YOUR-GATEWAY-PATH/gtag/js?id=G-XXXXXXXXXX"></script>
 <script>
   window.dataLayer = window.dataLayer || [];
   function gtag(){dataLayer.push(arguments);}
   gtag('js', new Date());
   gtag('config', 'G-XXXXXXXXXX');
 </script>
</head>

This works best with advanced consent mode (Option 1).

Check your setup

  1. Open your page with ?consentbit_debug=1 (see Debug mode). Consent default and Google requests should show PASS.
  2. In Google Tag Assistant, open the Consent tab. The first consent event should show the default before any Google tag fires. Under Hits Sent, the hits should go to your measurement path.

Note: ConsentBit debug mode's Script order check recognises Google tags by Google's own addresses, so a tag served from your own domain may not be listed there. Use Consent default, Google requests and Tag Assistant to confirm the setup.

Need help? Contact ConsentBit support with your page address and a screenshot of the debug panel.

‍

Frequently asked questions

No items found.
Didn’t find your answer?
Contact us here