Skip to Content
InstallationGoogle tag gateway (GTG)

Google tag gateway (GTG) and Google Consent Mode

Google tag gateway (GTG) is a Google-managed infrastructure feature that proxies Google tag requests through a domain you control instead of directly loading them from Google-owned domains such as googletagmanager.com or google-analytics.com.

GTG is compatible with Google Consent Mode and CookieHub. In most implementations, GTG does not affect how Consent Mode works.

However, GTG can expose existing script ordering or implementation problems, especially in mixed or custom setups where consent defaults are not initialized before Google tags execute.

This guide explains how GTG works with Consent Mode, how to identify GTG on your site, and how to troubleshoot common implementation issues.


What GTG actually changes

GTG mainly changes two things:

  • How Google tag scripts are loaded
  • Where Google measurement requests are sent

Instead of loading directly from Google domains:

https://www.googletagmanager.com/gtag/js https://www.google-analytics.com/g/collect

requests are proxied through your own domain:

https://yourdomain.com/gtag/js https://yourdomain.com/g/collect

GTG does not replace Google Tag Manager (GTM), disable Consent Mode, or bypass consent requirements.

Google tags still respect Consent Mode consent states as long as those consent states are initialized before the tags execute.


For Consent Mode to function correctly, consent defaults must be set before any Google tags initialize.

The correct sequence is:

  1. Consent defaults are initialized
  2. Google tags load
  3. Google tags read the consent state
  4. Tags operate according to the current consent settings
  5. Consent updates are applied after user interaction

Typical consent initialization:

gtag('consent', 'default', { ad_storage: 'denied', analytics_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied' });

GTG does not change this requirement.


When GTG can contribute to problems

GTG itself is usually not the root cause of late consent issues.

Problems typically occur when:

  • CookieHub loads after Google tags
  • scripts are reordered by optimization tools or CDNs
  • Google tags are hardcoded outside GTM
  • multiple consent systems are present
  • custom script injection changes execution timing

GTG can make these problems more visible because Google tags may become available earlier in the page lifecycle through proxy delivery.

This can lead to situations where Google tags initialize before consent defaults are established.

CookieHub may then report:

  • Late consent
  • Collect before consent
  • Missing consent signals

Important distinction for GTM users

If CookieHub is implemented correctly through Google Tag Manager using the Consent Initialization - All Pages trigger, GTG should normally not affect Consent Mode behavior.

In a standard GTM implementation:

  1. GTM container loads
  2. Consent Initialization trigger fires
  3. CookieHub sets consent defaults
  4. Google tags execute
  5. Measurement requests are proxied through GTG

In this setup, GTG is effectively transparent to Consent Mode.


How to verify whether GTG is active

Check Google tag script URLs

Inspect the Google tag script source on your website.

Without GTG:

https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXX

With GTG:

https://yourdomain.com/gtag/js?id=G-XXXXXXXX

If the script loads from your own domain, GTG is likely enabled.

Inspect network requests

Open browser DevTools (F12) and go to the Network tab.

Filter requests by:

gtag collect

If Google Analytics or Google Ads requests are sent through your own domain instead of Google domains, GTG is active.

Check GTM or Google tag configuration

GTG configuration may be visible in:

  • Google Tag Manager settings
  • Google tag settings
  • CDN or server-side proxy configuration

The approaches below apply regardless of whether GTG is active. GTG does not require a different Consent Mode setup — correct script ordering is what matters.

Using GTM with Consent Initialization is the most reliable setup.

Recommended configuration:

  • Use the CookieHub Community Template
  • Set the CookieHub tag trigger to Consent Initialization - All Pages
  • Do not add additional consent checks to the CookieHub tag itself
  • Let Google tags handle Consent Mode natively

Google tags with built-in Consent Mode support include:

  • Google Analytics
  • Google Ads
  • Floodlight

These tags generally do not require additional consent checks.

For third-party tags without native Consent Mode support, configure additional consent requirements separately. See Additional consent.

Direct HTML installation

If you are not using GTM:

  • Place the CookieHub script in <head>
  • Ensure CookieHub loads before any Google tag scripts
  • Do not use async or defer on the CookieHub script
  • Verify that optimization tools are not reordering scripts

Correct order:

<script src="https://cookiehub.net/..."></script> <script async src="https://yourdomain.com/gtag/js?id=G-XXXXXXXX"></script>

Incorrect order:

<script async src="https://yourdomain.com/gtag/js?id=G-XXXXXXXX"></script> <script src="https://cookiehub.net/..."></script>

Advanced Consent Mode allows Google tags to load immediately while operating with denied consent defaults until user consent is granted.

With advanced consent mode:

  • tags initialize immediately
  • cookieless pings may be sent while consent is pending
  • no advertising or analytics storage is used before consent
  • consent updates are applied after user interaction

This approach reduces dependency on perfect script ordering and helps minimize data loss while still respecting consent requirements.

CookieHub supports advanced consent mode for Google Consent Mode integrations. See Consent mode for setup instructions.

WordPress and plugin-based setups

If you are using the CookieHub WordPress plugin:

  • enable Google Consent Mode v2
  • ensure the plugin is updated
  • verify that caching, optimization, or CDN plugins are not delaying or reordering the CookieHub script
  • avoid running multiple consent systems simultaneously

If GTM is also used, avoid duplicate CookieHub installations through both the plugin and GTM.


If CookieHub reports late consent issues, work through the following checks.

Verify script order

Confirm that CookieHub initializes before Google tags using:

  • View Source (Ctrl+U)
  • DevTools Network tab
  • GTM Preview mode

Check GTM trigger order

If using GTM:

  • CookieHub must use Consent Initialization - All Pages
  • Google tags should fire afterward

Check optimization layers

Review whether any of the following are modifying script execution order:

  • CDN optimizations
  • script deferral or lazy loading
  • performance plugins
  • HTML rewriting tools

Use browser DevTools and Google Tag Assistant  to verify that consent defaults are initialized before Google tags execute. See Consent mode v2 signals for detailed instructions.


How CookieHub diagnostics help identify issues

CookieHub automatically monitors for Consent Mode implementation issues and surfaces findings in the Action Center and domain scan reports in the CookieHub dashboard.

Issues related to script ordering that CookieHub can detect include:

  • Late consent — consent signals arrived after Google tags had already started executing
  • Collect before consent — data collection activity was detected before consent defaults were established
  • Missing consent signals — required Consent Mode parameters were not found
  • Outdated Consent Mode configuration — an earlier version of Consent Mode is in use

If the Action Center reports any of these issues, review the script ordering and implementation approach described in this guide.

If you are unable to resolve the issue, contact CookieHub support. Include the domain name and any Action Center findings when submitting your request.


Common misconception

GTG does not bypass Consent Mode or automatically cause implementation issues.

Most problems attributed to GTG are actually caused by:

  • incorrect script order
  • mixed implementations
  • custom hardcoded tags
  • optimization tools altering execution timing

A correctly implemented GTM + Consent Initialization setup generally works without issues when GTG is enabled.


Additional Google resources

Last updated on