Sign in
Back to the scan

SERVER-SIDE ENDPOINT DIAGNOSIS

Fix HTTP 502 on tags.your-domain.com

A diagnostic guide for custom server-side GTM endpoints returning HTTP errors or nearing TLS expiry. Restore clean HTTP 200 delivery, then keep the endpoint monitored daily.

This is an example. Open this page from a scan report, with the "How to fix" link on an endpoint error, to see your own endpoint details. Scan your website

Site
your-domain.com
Endpoint
tags.your-domain.com
Path
/g/collect
Observed HTTP status
HTTP 502 (2 failed)

Why this happens

When a server-side tagging endpoint returns HTTP 4xx or 5xx, or when its TLS certificate expires, browsers drop tracking hits silently. Visitors see no error on the page, but GA4, Meta CAPI, and Google Ads stop receiving events immediately.

HTTP 502, 503, and 504 errors usually point to an offline or misrouted tagging server, a suspended hosting plan, or a broken Cloudflare proxy rule. HTTP 400 and 404 errors typically mean the request path does not match any active client in the server GTM container (for example after renaming a path or removing a GA4 client).

The steps

Who usually does what.

  1. 1

    Check server container hosting and billing status

    Marketer or developer
    Log into your sGTM host (Cloud Run, Stape, TAGGRS, or your own reverse proxy) and confirm the container is running, within plan limits, and passing health checks.
  2. 2

    Verify DNS records and CDN proxy settings

    Developer
    Confirm the CNAME or A record for the tagging subdomain points to the right origin. On Cloudflare, verify proxy mode (orange vs grey cloud), SSL/TLS mode (Full Strict), and ensure WAF or bot rules do not block /g/collect or /gtm.js.
  3. 3

    Check matching clients in server GTM Preview

    Analytics specialist
    Open sGTM Preview and send a test hit to the failing path. If the server returns HTTP 400 or 404, verify the Google Analytics 4 or custom client is published and configured to claim that exact path.
  4. 4

    Inspect custom-domain TLS certificate renewal

    Developer
    Check whether automatic certificate renewal (Let's Encrypt, Google-managed, or Cloudflare Universal SSL) is blocked by a CAA record, broken ACME challenge, or mismatched DNS.
  5. 5

    Confirm HTTP 200 delivery and monitor daily

    Everyone
    Re-scan your domain on isblocked.fyi to verify the endpoint reports Healthy (HTTP 200), confirm events arrive in GA4 DebugView, and keep daily monitoring active.

5 things to get right: checklist

Check each item before considering the endpoint healthy again.

Server 5

Server

Origin container responds with HTTP 200 on live paths

A healthy root /healthz check is not enough if /g/collect or your custom loader path returns HTTP 400 or 404.

CDN and WAF rules exclude the tagging path from bot challenges

Cloudflare Bot Fight Mode or rate-limiting rules can intercept server-side tracking POST requests and return 403 or 503.

Same-origin reverse proxy forwards client IP and headers

If the proxy strips Host, User-Agent, or X-Forwarded-For headers, the server container or downstream vendor rejects or misattributes hits.

TLS renewal is automated and verified

Fix the root cause of an expiring certificate (CAA records, proxy validation, or manual cert upload) rather than renewing once by hand.

Daily monitoring covers both blocking and endpoint health

An endpoint can stay unblocked by ad blockers and still drop 100% of events due to a 502 or expired certificate.

Keep watching your server-side endpoint

Silent 502s and expired certificates drop tracking without showing any error to your visitors.

Everything above makes a request hard to match. None of it stops a blocker from doing the one thing it can always do: block the whole host. After that the blocker no longer looks at the path, the payload or the encryption. It only looks at where the request goes.

A rule matches a path or a file name

Solved by moving it and encrypting the path.

A rule matches the parameters or the body

Solved by encrypting the payload, differently every time.

A blocker blocks the whole host

Cannot be solved. Every request to that host is dropped, however it looks. It can only be replaced.

What works is to notice within a day and to change the host fast. A setup that is watched costs you a day. One that is not costs you the weeks until someone looks at the numbers.

With monitoring

  1. Day 0A blocker blocks your host
  2. Day 1The next check finds it and you get an email
  3. Day 1You move to a new host
  4. Day 2The scan is clear again

Without it

  1. Day 0A blocker blocks your host
  2. Week 2Someone notices the numbers drop
  3. Week 3The cause is found, and the move begins
  4. Week 4Without context, solving it takes longer

What to watch

  • Your full masking setup. Once it is live, monitor it continuously so a blocked host or broken request is caught quickly.
  • The host you choose. Watch it as a pattern. You get an email the day a product starts blocking it, before any scan runs.
  • Your website. Domain monitoring scans it every day and finds your tagging endpoint by itself, so it also tells you when the endpoint is blocked.

Needs a free account. You can also add it later in the Watchlist.

Be ready to move in an hour

  • Keep the host in one place of your configuration, not in many tags.
  • Set a short DNS TTL on it, so a change takes minutes to spread.
  • Have a second host ready, set up and tested. Switching to it should be a change of one value.
  • Write down the steps and who does them. The day you need them is the wrong day to work them out.

Get help with this

You can troubleshoot all of this yourself using the checklist above.

If your server-side GTM endpoint is dropping data right now, or you want an expert to review your architecture and train your team on keeping sGTM resilient, bring your scan and we will fix it together.

Mariusz Brucki

Who is behind this

Mariusz Brucki

Consultant and trainer for agencies. Server-side tracking and ad blockers. Berlin, remote.

Hi, nice to meet you. I'm the founder of isblocked.fyi, and I appreciate your trust. Having worked with brands like Greenpeace and DocPlanner, I've learned what a resilient tracking setup needs for analytics and advertising. In 2025, I developed encryption technology for bypassing adblockers for analytics and tracking systems and partnered with a major server-side tracking company, TAGGRS, to roll it out to thousands of customers. I'm here to help if you do not want to work through the setup alone, or if you want someone to share the know-how. I also work with agencies to help them set up tracking safely for their customers.

sGTM architecture review and training

For teams and agencies running server-side GTM who want a reliable custom-domain setup and a team that knows how to debug it. Bring your scan.

  • Trace HTTP 4xx/5xx failures across DNS, Cloudflare proxy, tagging server, and GTM clients
  • Review TLS certificate provisioning and custom-domain renewal workflows
  • Train your team on sGTM preview debugging, routing rules, and failover planning
  • Set up daily endpoint health and certificate monitoring

sGTM repair and hardening

We diagnose and repair your broken server-side endpoint, DNS/proxy routing, or expiring certificate so measurement recovers fast.

  • Fix server container routing, custom domain DNS records, and proxy headers
  • Repair or renew custom-domain TLS certificates before browsers reject hits
  • Verify clean HTTP 200 responses and event delivery into GA4 and ad platforms
  • Leave a documented runbook and daily monitoring active