Preview works. Live doesn't.
Debugging a server-side GTM outage for an iGaming client: every check said 200, the response body said 400, and the fix was one click nobody expected.
- Role
- Tracking specialist
- Client
- iGaming client, Irish market
- Period
- October 2026
- Stack
- Server-side GTM · Kubernetes · Cloudflare · GA4
- Outcome
- ✦ GA4 and all four vendors back online, after a fix that was trusted, not lucky
The setup: one endpoint carries every vendor
The client's tracking ran through a single server-side GTM endpoint:
Browser → Cloudflare → sGTM → Vendors
- Browser: web GTM sends GA4 and vendor hits
- Cloudflare: same-origin path on the client's domain
- sGTM: runs on Kubernetes, with live and preview deployments
- Vendors: GA4, Google Ads, TikTok and AdForm
When the server fails, all four vendors go dark at once, and nothing in the browser looks broken.
The symptom: GA4 didn't decline. It switched off.
90–99%
of hourly page views lost
In sudden on/off windows
5,802
page views an hour at peak
Normal hours looked completely healthy
4
vendors affected at once
GA4, Google Ads, TikTok, AdForm
The outages ran on 20 October from 11:00 to 13:59, and again on 21 October from 10:00 (Irish time). Between them, traffic looked completely normal.
The clue: every check said 200, but the body said 400
With Preview on, everything looked healthy: the GA4 client claimed the request, the incoming request returned 200, and GA4, Ads, TikTok and AdForm all returned 200.
With Preview off, the browser still saw HTTP 200 OK from Cloudflare. The response body told a different story:
HTTP 200 OK (Cloudflare)
event: message
data: {"response":{"status_code":400,"body":""}}Grafana stayed green the whole time. It read the HTTP status, not the status inside the body.
The investigation: ten checks, outside in. All clean.
| # | Check | Result |
|---|---|---|
| 1 | Suspect web publish from early October | Only a TikTok update had changed |
| 2 | GA4 tags: triggers, exceptions, pauses | All sending to the server, none blocked |
| 3 | Consent blocking and new GA4 parameters | TikTok-only blocking; parameters only add data |
| 4 | Shape of the drop, hour by hour | On/off outages of 90–99% |
| 5 | Preview vs live in DevTools | Preview 200; live 400 inside a 200 |
| 6 | Server container: client, tags, templates | Unchanged for months |
| 7 | Cloudflare cache | DYNAMIC: hits reached the origin |
| 8 | Hit contents: protocol, routing, consent | HTTPS, parameter present, consent granted |
| 9 | Deployment config on the live pods | Right container, live environment |
| 10 | FPID first-party cookie | Missing: no hit was ever processed |
Still open, so we turned to the infrastructure
- Pod routing: real hits landing on preview pods would get exactly this empty 400.
- Unhealthy live pods: restarts, a failed container download, or a new image on the moving stable tag.
- A change at the outage start: a publish, a Kubernetes rollout or a Cloudflare change.
- The service worker: Google's streamed responses behaving differently behind Cloudflare.
I had everything ready for the next step: kubectl checks for DevOps, an emergency fallback, and two escalation emails to Google.
The fix (brace yourself)
We clicked Publish. On absolutely nothing.
No new tags. No new triggers. Not one setting touched. The server shrugged, claimed every hit, and GA4 came back as if nothing had happened.
10
clean checks
2
emails drafted to Google
1
click on Publish
Changes in this version: 0
Why it worked: preview and live don't run the same thing
- Preview loads the current workspace directly. That's why every container check looked clean.
- Live runs the last published version, which it downloads from Google and keeps in memory until a new version appears.
Most likely, live was holding a broken copy with no active GA4 client. A new publish forced a fresh download.
What we took from it
- A 200 can hide a failure. Read the status inside the response body, and make your monitoring read it too.
- Preview working is a clue. When only live fails, compare what each one is actually running.
- Look at the shape of the data. Hourly data turned "declining" into "switching off".
- Press the boring button first. A no-change republish takes a minute and can't break anything. Ask us how we know.
- Ruling out isn't wasted. With everything else proven clean, the fix was trusted, not lucky.
- #server-side-gtm
- #ga4
- #debugging
- #kubernetes
- #cloudflare