One-click CDN injection
Google tags are injected through the CDN, often without manually placing the tag script in your page template. This is convenient, but it can also mean the CDN controls when the tag loads.
Google Tag Gateway (GTG) is Google’s first-party tag delivery solution. Instead of loading Google tags directly from Google domains, the tags are served through your own domain, CDN, or CMS and then routed onwards to Google.
That can be useful for measurement reliability, but it is important to understand what GTG is — and what it is not.
Read Google’s official Google Tag Gateway documentation for the full setup details.
GTG setups usually fall into one of these patterns:
One-click CDN injection
Google tags are injected through the CDN, often without manually placing the tag script in your page template. This is convenient, but it can also mean the CDN controls when the tag loads.
Via Google Tag Manager
GTM itself is deployed through GTG. Tags are managed in the GTM container, while delivery is routed through the gateway.
Manual setup
Your team configures GTG directly and controls how scripts are imported on the page. This gives you the most control over script order.
Consent Mode still needs to be configured correctly when GTG is used. Cookifi needs to set the Consent Mode default command before Google tags execute, and then send the update command when the visitor’s consent state is known.
The tricky part is load order.
With one-click CDN injection, Google tags can be inserted directly into the page <head> by the CDN.
This often removes the customer’s control over the normal page script sequence. In practice, this can
mean a Google tag starts before Cookifi has loaded or before the Consent Mode default command has
been issued.
Cookifi does not try to automatically detect GTG, because automatic detection is brittle. GTG is designed to be difficult to fingerprint, and its implementation details may change.
Instead, check GTG manually in Google Tag Manager / Google tag settings.
Depending on your Google UI, you may also see GTG verification inside the Google tag settings for a specific tag. If the labels differ, follow Google’s instructions for accessing Google tag settings.
You can also inspect your website’s network requests. If Google tag files or collection requests —
for example gtag.js or /g/collect — are being served from your own domain instead of Google
domains, GTG is active for those requests.
In Cookifi, use the Google Consent Mode debug script from your property settings under
General > Google Consent Mode debug script. Place it temporarily as the first script in your page
<head> and reload the page.
If it reports late consent, it means Google tag execution was detected before the Consent Mode default command.
When that happens, first check whether the affected Google tag is enrolled in GTG using the steps above. If it is, follow one of the remediation paths below.
If Google tags are loading before consent is available and GTG enrollment is verified, there are a few ways to fix the setup. The right option depends on how much control you have over the page, CDN, and GTM container.
For GTG-enabled tags, advanced Consent Mode is the recommended mechanism because it works even when GTG affects script order.
In this approach, Google tags can load while consent is still pending, but they receive Consent Mode defaults and are restricted according to the configured consent state.
Configure Global Consent Defaults and Data Transmission Controls according to your needs, and let Cookifi send the Consent Mode update command when the visitor makes a choice, or when implied consent applies in an opt-out region.
Read more in our advanced Consent Mode guide.
Another option is to move your Google tags into a Google Tag Manager container and deploy GTM itself through GTG.
This gives you a single place to manage tag behaviour and consent settings. It is often easier to reason about than having some tags injected by the CDN and others loaded from the page template.
If you need help with this step, see our guide on how to migrate your tracking scripts to Google Tag Manager.
This option is available if you set up GTG manually and your team controls how scripts are imported on the page.
In that setup, make sure Cookifi’s Consent Mode default command loads before Google tags initialise. This restores the usual load-order control you have in a standard, non-CDN-injected implementation.
After changing your setup, verify that: