Google Tag Gateway: checking that it actually works
Tag Gateway serves Google's scripts from your own domain. What changes on the wire, how it differs from server-side GTM, and the four ways it quietly half-works.
Tag Gateway moves the delivery of Google's measurement onto your own domain. Instead of the browser
fetching gtag.js from googletagmanager.com and posting to
google-analytics.com, both go through a measurement path on your host — something like
example.com/metrics/… — which your CDN forwards to Google.
It is not server-side GTM, and the difference matters
These get conflated constantly, and they fail in completely different ways.
- Server-side GTM moves tag execution to a container you run. The browser sends one request to your server; your server decides what to forward and to whom. You can rewrite, enrich or drop events there.
- Tag Gateway moves only the transport. The tags still execute in the browser, the payload is unchanged, and your infrastructure is a pipe rather than a participant.
You can run both, either, or neither. If you are debugging a missing event, knowing which one is in play tells you whether to suspect a container configuration or a routing rule.
What changes on the wire
Nothing inside the request. tid, en, cid, the event parameters, the
items, the consent flags — all identical. What changes is the host and the path prefix. That single fact
explains why so many debugging tools go blank: they recognise Google hits by hostname, and the hostname is
now yours.
Reading the requests by path instead — a /g/collect anywhere, on any host — keeps them
visible, which is the same trick that makes server-side GTM hits readable.
Four ways it half-works
- The script is first-party but the hits are not. A partial configuration serves
gtag.jsfrom your domain while collection still goes to Google. Everything looks fine in reports and you have none of the durability you set this up for. Check the host on the/g/collectrequest, not on the script. - The measurement path collides with an application route. If your app already answers on that prefix, or your router has a catch-all, the CDN rule never gets a chance and requests come back as your own 404 page. A 404 on a collect request is not a tracking bug you will find in GA4; it is only visible in the network.
- A cache rule catches the endpoint. Measurement paths sit on the same domain as your
pages, so a broad caching rule can apply to them. A cached collect response does not lose the hit — the
request still leaves — but a cached
gtag.jscan pin visitors to an old configuration for as long as the TTL says. - Consent is unchanged and people assume otherwise. First-party delivery does not alter
what you are allowed to collect, when Consent Mode signals are read, or whether a banner has to appear.
The
gcsandgcdparameters travel exactly as before, and they are the thing to check.
Tag Master matches on the request path rather than the hostname, so gateway traffic is recognised, labelled and decoded like any other GA4 hit — including the consent state it carried.
The part worth being deliberate about
Some of the reported uplift from first-party serving comes from requests that a content blocker would have stopped on a Google hostname and does not stop on yours. That is a real effect and worth understanding rather than discovering later: it is a decision about how you treat visitors who have chosen to block tracking, and it is separate from whether your consent implementation is correct.
A routine
- Load a page and find the
gtag.jsrequest. Note its host. - Find a
/g/collectrequest. Note its host too. If the two disagree, the configuration is half-done. - Check the status code. A gateway misroute shows up as a 404 or a redirect, never as missing data in a report.
- Open the hit and confirm
tid, the event name andgcsare what they were before the migration. The payload should be untouched. - Walk a conversion end to end and compare the numbers with the previous setup before you decommission it.
Related guides
- When GA4 says the traffic came from somewhere else
- Tracking inside an embedded widget
- How to debug server-side GTM
Try it on your own site
Tag Master is free, needs no account, and collects no data.
Add to Chrome — Free