On this page
What this issue is
Server-side tracking means your website or browser sends events to a server you control, such as a server-side Google Tag Manager (sGTM) container, a first-party tracking subdomain or your own API. That server then forwards them to ad and analytics platforms. The endpoint is the URL that receives those events.
A 5xx status code means the server failed, not the visitor. Common ones: 500 (internal error), 502 (bad gateway, the proxy got a bad answer), 503 (unavailable or overloaded) and 504 (timeout). Intermittent means most requests work and some fail, which makes it easy to miss.
- Visitor convertsForm sent or order placed
- Event sent to your endpointPOST to your server-side URL
- Endpoint returns 5xx502, 503 or 504 on some requests
- Forwarded to GA4 / Ads / MetaNever happens
- Attribution and biddingConversion missing from reports
The browser did everything right, but the server-side step failed, so the platforms never hear about the sale.
Why it costs you leads or sales
The visitor still gets their confirmation, so nothing looks wrong on the site. But each failed request is a conversion the ad platforms never see. Smart bidding then learns from incomplete data, reports undercount, and campaigns can look worse than they are. Because only some requests fail, the gap is easy to blame on ad blockers or consent instead.
Example: 200 real conversions, with 8% of server-side requests failing at peak times.
How to check if your site has it
Open browser DevTools
In Chrome, press F12, open the Network tab and filter by your tracking domain (for example metrics.yourdomain.com). Convert on a test form or page and look for red requests with a 5xx status. Repeat several times, since failures are intermittent.
Check the server logs
For sGTM on Google Cloud, open Logs Explorer for the Cloud Run or App Engine service and filter by severity ERROR or by httpRequest.status>=500. Note the times and the paths.
Look at the metrics
In Cloud Run, check the Metrics tab for request count by response code, container instance count, CPU and memory. Spikes in 5xx that line up with high load or instance limits point to capacity.
Test with a quick loop
Send repeated requests to a health or ping URL and count non-200 answers, as in the snippet below.
for i in $(seq 1 100); do
curl -s -o /dev/null -w "%{http_code}\n" https://metrics.example.com/healthz
done | sort | uniq -cFor sGTM, /healthz is the built-in health check path. If your own endpoint has a different path, use that. Replace the domain with yours.
How to fix it
The right fix depends on what the logs show. Match the symptom to the likely cause first.
| Status | Likely cause | First thing to try |
|---|---|---|
| 500 | Error in a tag, client or custom code | Read the stack trace in the logs; fix or disable the tag |
| 502 | Instance crashed or proxy got an invalid reply | Check memory limits and crashes; review proxy or load balancer |
| 503 | No free instances, overload or deploy in progress | Raise minimum and maximum instances |
| 504 | Request took too long, often a slow downstream API | Raise timeouts and fix slow destinations |
Raise minimum instances
If your server container runs on Cloud Run, set the minimum instances to at least 2 (Google recommends more than one for production) and raise the maximum so traffic spikes can scale out.
Check CPU and memory
If logs show out-of-memory or CPU throttling, increase memory and CPU for the service.
Find failing tags
In the server container, open Preview and replay a failing request. Look for tags with errors or very slow responses, and fix or pause them.
Publish and test
Publish the container, then repeat the check loop and confirm the 5xx count drops.
Read the error log
Find the exact exception behind each 500 in your application log and fix it, including handling of missing or malformed fields.
Add timeouts and retries
When calling GA4, Meta or other APIs, set a sensible timeout and retry with a short back-off on 429 and 5xx answers from them.
Respond fast, process later
Return 200 quickly and forward the event through a queue or background job, so slow destinations do not cause 504s.
Check the proxy
In Nginx or your load balancer, make sure upstream timeouts are longer than your slowest normal response and that upstream health checks are correct.
Identify the relay
If a plugin sends server-side events (a CAPI or sGTM plugin), check its log or debug screen for failed requests.
Check hosting limits
Shared hosting can return 503 or 508 when PHP workers or resources run out. Ask your host or upgrade the plan.
Update and test
Update the plugin, clear caches, and disable conflicting plugins one at a time while repeating a test conversion.
Check the app or pixel
If a server-side app sends events, open its dashboard for failed deliveries and error codes.
Check your own endpoint
If the app forwards to your sGTM subdomain, test that subdomain with the curl loop above.
Contact the app vendor
If errors come from the app's own servers, send them the timestamps and status codes.
How to confirm it's fixed
- The curl loop returns only 200 responses over several runs, including at a busy time of day
- Logs Explorer shows no 5xx for your endpoint over the last 24 hours
- Instance count scales up under load without errors
- A test conversion appears in GA4 DebugView and in Meta Events Manager Test Events
- Server-side conversion counts match browser-side counts within a normal margin
How to prevent it happening again
- Set an alert on the 5xx rate in your cloud monitoring tool
- Keep at least two minimum instances for production tagging servers
- Test new tags in Preview before publishing
- Set billing alerts so a cost cap does not stop the container
- Re-test the endpoint after every deploy, plugin update or DNS change
- Compare server-side and browser-side conversion counts weekly
Day 1
A new tag slows responses; a few requests time out with 504.
Day 3
A campaign starts. Traffic grows and more requests fail.
Day 10
Ad platform conversions look lower than orders in your shop.
Day 11
Logs show the 5xx pattern. You raise instances and fix the slow tag.
How FunnelGuard handles this
FunnelGuard detects this issue only partly. It runs your real customer journeys on a schedule and captures the status of the tracking requests sent during them, so if your server-side endpoint returns a 5xx during a check, that status is captured. A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause.
What it does not do: a check only sees the requests made during each scheduled run, so a failure that hits a small share of real visitors, or only at peak traffic, can pass between checks. It also does not read your server logs, instance metrics or the failures that happen between your server and ad platforms.
Cover the rest by hand: set up 5xx alerts in your cloud monitoring, review the server logs after traffic spikes, and compare server-side and browser-side conversion counts regularly. The Free plan includes 1 site and 2 journeys with daily checks and no card needed, and paid plans have a 3-day free trial.
Overloaded
Leads or data lost
Some events get 502/503/504 and never reach GA4, Google Ads or Meta, so conversions are undercounted.
Toggle to see how the endpoint state changes what the ad platforms receive.
Questions people ask
Why is my server-side GTM returning 502 or 503 errors?
Usually the container has too few instances or too little memory, so requests fail when traffic rises or an instance crashes. Check Cloud Run metrics and logs, raise minimum and maximum instances, and increase memory if you see out-of-memory errors.
What does a 504 on my tracking endpoint mean?
A 504 means the request timed out before an answer came back. It is often caused by a slow downstream API or a tag that takes too long. Fix the slow call, add timeouts and retries, or respond first and forward events in the background.
How do I find intermittent 5xx errors in my server-side tracking?
Filter your server logs for status 500 and above, and compare the times with traffic and instance metrics. You can also send repeated requests to the health URL with curl and count the non-200 answers. Check at busy times, since errors often show up under load.
Will a 5xx on the server-side endpoint hurt my ad campaigns?
Yes, indirectly. Missing conversions make reports look worse and give bidding algorithms less data to learn from. The visitor sees nothing wrong, so the loss can last a long time unnoticed.
Are 5xx errors the same as ad blockers blocking my tracking?
No. An ad blocker stops the request leaving the browser, so your server never sees it. A 5xx means your server received the request and failed to handle it, and your logs will show it.
How many minimum instances should a server-side GTM container have?
Google recommends running more than one instance for production, so a single crash or deploy does not take the endpoint down. Start with at least two and raise the maximum so it can scale during spikes.
Can FunnelGuard detect server-side 5xx errors?
Partly. FunnelGuard captures the status of tracking requests during its scheduled journey checks, so a 5xx seen in a run is caught. It cannot see failures between runs or read your server logs, so keep cloud monitoring alerts as well.
Related issues
- TRK-367Server-side GA4 event not arriving (Measurement Protocol)Fix guide
- TRK-372Server-side tagging cost overrun shutting containerFix guide
- TRK-376First-party tracking subdomain SSL expiredFix guide
- TRK-373Webhook to analytics (Zapier) failing silentlyFix guide
- TRK-368Meta CAPI token expiredFix guide
- TRK-375TikTok Events API token invalidFix guide