Working with Google Tag Gateway (GTG)

What is Google Tag Gateway?

Google Tag Gateway (GTG) is a feature that lets advertisers serve Google tags (gtag.js and gtm.js) from their own domain instead of from googletagmanager.com. For example, the tag loads from https://www.yourdomain.com/gtm.js through a CDN proxy like Cloudflare, Fastly, or CloudFront, rather than from https://www.googletagmanager.com/gtm.js.

GTG doesn’t collect any additional data. It only changes how the script is delivered, with the goal of improving performance and reliability. Consent Mode keeps working as normal, and GTG respects every consent choice your users make in the cookie banner. For the basics of the consent signals themselves, see Working with Google Consent Mode.

More information from Google: How Google tag gateway works

How GTG affects consent load order

In a standard setup, the consentmanager by iubenda CMP script loads before any Google tags, so consent signals reach Google before tracking starts.

With GTG, the Google tag is served from your own domain through a CDN. In some configurations, especially with one-click CDN injection, the CDN automatically injects the Google tag at edge level. This can place it ahead of the CMP script, which breaks the correct consent signal order:

Correct orderProblematic GTG order
1. CMP loads1. GTG injects the Google tag
2. CMP sends consent default2. Google tag fires (no consent signal yet)
3. Google tag loads3. CMP loads and sends consent default, too late

When the Google tag fires first, it doesn’t see a consent default signal. We call this late consent. The result: data may be collected before consent is established, or consent signals may be ignored entirely.

One-click CDN injection is the most common cause of late consent in GTG setups. It speeds up the rollout but takes load-order control away from you, which is exactly the control the CMP needs to keep tracking aligned with consent.

When late consent happens on a page using consentmanager, the browser console surfaces a warning that links to this page:

Browser console showing the consentmanager warning: Late consent detected. Google Consent Mode default was set after the Google tag (gtag.js/GTM) fired. Ensure the CMP script loads before the Google tag.
Browser console showing the consentmanager warning “Late consent detected: Google Consent Mode default was set after the Google tag (gtag.js/GTM) fired. Ensure the CMP script loads before the Google tag.” followed by a link to this page.

How to verify if GTG is active on your site

  1. Open your website in an incognito window.
  2. Open DevTools (F12) and go to the Network tab.
  3. Search for gtm.js or gtag.js.
  4. Check the domain the file loads from:
    • From googletagmanager.com or google-analytics.com: GTG is not active.
    • From your own domain (e.g., yourdomain.com/gtm.js): GTG is active.

Not active:

DevTools Network tab filtered for gtm.js, showing the request served from the www.googletagmanager.com domain, which means GTG is not active.
GTG is not active: gtm.js loads from www.googletagmanager.com.

Active:

DevTools Network tab filtered for gtm.js, showing the request served from the site's own domain, which means GTG is active.
GTG is active: gtm.js loads from your own domain.

Alternatively, run this in the Console tab:

document.querySelectorAll('script[src]')

Look for any script where src contains /gtag/js or /gtm.js but points to a non-Google domain. For more on how GTG serves tags from your own domain, see Google’s tag gateway setup guide.

What to do if late consent is detected with GTG

The consentmanager diagnostic tool flags late consent as an issue under your site’s Monitoring → Overview view:

consentmanager diagnostic tool Issues panel listing three rows: Google Ads is loaded without consent, consentmanager may transfer, store or process personal data outside of the EEA/EU but is loaded without consent, and Google Consent Mode default is set too late.
The Issues panel flags “Google Consent Mode default is set too late”, with an explanation of what it means and how to fix it.

If the diagnostic tool or debug mode reports a late consent warning and you’ve confirmed GTG is active, you have three options to resolve it.

Option 1: Adopt U+C (recommended)

Enroll in User + Consent (U+C), Google’s advanced consent mode. With U+C, Google’s infrastructure natively understands and respects CMP consent signals regardless of script load order. U+C is also compatible with manual GTG setups, which is why we recommend it for any site running GTG-enrolled tags.

To enable U+C:

  • Contact your Google representative or apply through Google’s enrollment process.
  • In consentmanager, confirm all four consent signals are configured: ad_storage, analytics_storage, ad_user_data, ad_personalization.
  • Enable Data Transmission Controls (DTCs) and Global Consent Defaults in your consentmanager settings to match your tracking and compliance needs.

When DTCs or Global Consent Defaults are active, consent defaults are set to granted in regions where consent is not legally required and the banner does not appear, so measurement keeps working as intended.

U+C is the recommended path for sites using GTG-enrolled tags. It’s the only option that works reliably with manual GTG and removes script-order timing as a risk.

Option 2: Deploy GTM via GTG

Move all your tags into a Google Tag Manager (GTM) container and configure GTG to serve that container. Then load the consentmanager CMP script as the first tag inside the GTM container, set to fire on All Pages with the earliest possible firing priority.

This way the CMP initializes before any other tag fires, even when GTM itself is delivered via GTG.

Steps:

  1. Create a new tag in GTM for the consentmanager script.
  2. Set it to fire on All Pages with the highest priority (for example, priority 999).
  3. Make sure no other tag fires before it.

Option 3: Set up GTG manually with controlled script order

If you manage GTG configuration directly, without GTM, you can adjust your CDN or server setup to control script load order. Two ways to do this:

  • Configure your CDN to inject the consentmanager CMP script before the Google tag script, or
  • Exclude the Google tag from CDN-level automatic injection and load it manually in your page HTML, after the CMP script.

This option needs direct CDN or server access and a technical understanding of how scripts are injected.

Summary

OptionDifficultyBest for
U+C (User + Consent)Low. Contact Google.Most sites. Recommended.
GTM container via GTGMedium. Requires GTM setup.Sites already using GTM.
Manual GTG script orderHigh. Needs CDN expertise.Advanced setups only.

If you’re not sure which option fits your setup, get in touch with consentmanager support and we’ll walk through it with you.

We do our best to keep this purely informative documentation up to date. However, if you notice that any of these guides need a little touch-up, let us know!