Skip to content
Iurie — home
All work
Case study3 min read

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.

#CheckResult
1Suspect web publish from early OctoberOnly a TikTok update had changed
2GA4 tags: triggers, exceptions, pausesAll sending to the server, none blocked
3Consent blocking and new GA4 parametersTikTok-only blocking; parameters only add data
4Shape of the drop, hour by hourOn/off outages of 90–99%
5Preview vs live in DevToolsPreview 200; live 400 inside a 200
6Server container: client, tags, templatesUnchanged for months
7Cloudflare cacheDYNAMIC: hits reached the origin
8Hit contents: protocol, routing, consentHTTPS, parameter present, consent granted
9Deployment config on the live podsRight container, live environment
10FPID first-party cookieMissing: no hit was ever processed

Still open, so we turned to the infrastructure

  1. Pod routing: real hits landing on preview pods would get exactly this empty 400.
  2. Unhealthy live pods: restarts, a failed container download, or a new image on the moving stable tag.
  3. A change at the outage start: a publish, a Kubernetes rollout or a Cloudflare change.
  4. 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

  1. A 200 can hide a failure. Read the status inside the response body, and make your monitoring read it too.
  2. Preview working is a clue. When only live fails, compare what each one is actually running.
  3. Look at the shape of the data. Hourly data turned "declining" into "switching off".
  4. Press the boring button first. A no-change republish takes a minute and can't break anything. Ask us how we know.
  5. Ruling out isn't wasted. With everything else proven clean, the fix was trusted, not lucky.
  • #server-side-gtm
  • #ga4
  • #debugging
  • #kubernetes
  • #cloudflare

Keep reading