Skip to content
Back to Documentation

COKIQ docs

Google tag gateway (GTG) and COKIQ

What Google tag gateway for advertisers changes for consent, how to check if your Google tag uses it, and how to fix a late consent signal with COKIQ.

Best for

Site owners, marketers and agencies who use COKIQ with Google tags served through Google tag gateway (Cloudflare, Akamai, Google Cloud or a manual setup).

What Google tag gateway changes

Google tag gateway for advertisers (GTG) serves your Google tag from your own domain instead of a Google domain. Google: "Google tag gateway for advertisers lets you deploy a Google tag using your own first-party infrastructure, hosted on your website's domain."

Where the tag comes from

Without GTG the page loads the Google tag from www.googletagmanager.com. With GTG it loads from a path on your own domain (for example https://www.example.com/abcd/?id=G-XXXX), and some measurement requests go to your domain, which forwards them to Google. GTG changes how data reaches Google, not whether consent is needed.

Impact on consent

Consent Mode only works if the consent default is set before a Google tag runs. One-click CDN setups (for example Google Tag Manager > Admin > Google tag gateway with Cloudflare) often inject the Google tag into your pages at the CDN. You usually cannot control where it is injected, so the Google tag can run before COKIQ sets the default: a "late" consent signal.

Impact on COKIQ basic mode

In basic mode COKIQ holds Google tags until consent. COKIQ also recognises first-party gateway URLs (any script URL with ?id=G-, GT-, GTM-, AW- or DC-). A tag that a CDN injects into the HTML before the COKIQ script runs cannot be held by any script on the page.

What Google recommends for GTG tags

U+C (advanced consent mode) is the recommended mechanism for GTG-enabled tags because it is compatible with manual GTG: tags load, read the consent state and only send full data once consent is granted.

Setup steps

Step 1

Verify whether your tag is enrolled in GTG

In Google Tag Manager open Admin > Google tag gateway. Status "Active" and a domain marked "First-party" means GTG is on for that domain ("Not started", "Paused" or "Pending" means it is not serving yet). In Google Ads or Google Analytics, open your Google tag settings and look for the Google tag gateway section. In the browser, open DevTools > Network and reload: if gtag/js or gtm.js loads from your own domain instead of www.googletagmanager.com, the tag is served through GTG. COKIQ debug mode (?cokiq_debug=1) also prints a warning when a Google tag is served from your own domain.

Step 3

Option 2: put all tags in one GTM container and deploy GTM via GTG

Move your Google tags into a single Google Tag Manager container, deploy that container through Google tag gateway, and add the COKIQ GTM template on the Consent Initialization - All Pages trigger. The template sets the consent defaults (per region) and loads COKIQ before any other tag in the container fires.

Step 4

Option 3: set up GTG manually so you control the load order

Use Google's self-service (manual) GTG setup instead of one-click CDN injection, and keep the COKIQ script as the first script in <head>, before the first-party Google tag.

Step 5

Check again

Reload a page with ?cokiq_debug=1. The console should say "OK: COKIQ set the consent default before any Google tag ran". Confirm in Tag Assistant (Consent tab) that the default appears before the first Google tag event.

Implementation checklist

  • GTG status checked in Tag Manager (Admin > Google tag gateway) or in the Google tag settings
  • DevTools shows whether gtag/js or gtm.js loads from your own domain
  • Late default fixed with advanced mode + Data Transmission Controls + Global Consent Defaults, a GTM container via GTG, or manual GTG
  • COKIQ debug mode reports no LATE CONSENT message
  • Tag Assistant shows the consent default before the first Google tag event

Important boundaries

  • GTG is configured in your Google and CDN accounts. COKIQ cannot switch it on or off for you.
  • Data Transmission Controls and Global Consent Defaults are set in Google's interface, not through the COKIQ script.

FAQ

Does COKIQ work with Google tag gateway?

Yes. COKIQ sets the Consent Mode default and update for Google tags served by GTG in the same way as for tags from googletagmanager.com. What matters is the load order: the COKIQ default must come first, or you use advanced mode with Data Transmission Controls and Global Consent Defaults.

COKIQ debug mode says LATE CONSENT. What first?

First check whether the late tag uses GTG (step 1). If it does, use one of the three options on this page. If it does not, move the COKIQ script to the top of <head> or fire the COKIQ GTM template on Consent Initialization - All Pages.

Who do I contact?

COKIQ support first (support@cokiq.com), not Google. Send the debug report from the console and we help you fix the order.