You wired up the GA4 Measurement Protocol, POSTed a purchase event from your server, and got back a clean 2xx success response. You opened GA4 expecting to see it - and nothing. No event in Realtime, no purchase in the reports, or worse: a flood of new sessions attributed to “(not set)” and “Direct” that inflate your user count and wreck your attribution. Your store sold 100 orders; GA4 shows 60.
Here is the trap almost everyone falls into: the Measurement Protocol’s success response does not mean your event was accepted. It means the request was received. A wrong API secret, an invalid event name, a missing session_id, or pure nonsense all return the same success code. This guide walks through every Measurement Protocol gotcha that makes server-side events vanish or misbehave - validated against Google’s official documentation - and the exact architecture that fixes them.
The Core Trap: A 2xx Success Validates Nothing
The GA4 Measurement Protocol accepts events at a single endpoint:
POST https://www.google-analytics.com/mp/collect?measurement_id=G-XXXXXXXX&api_secret=YOUR_SECRET
Google’s documentation is blunt about what the response means: the endpoint “returns a 2xx status code if the HTTP request is received,” and it “doesn’t return an error code if the payload is malformed, or if the data is incorrect or not processed by Google Analytics.”
Read that twice. A success response confirms the bytes arrived. It says nothing about whether GA4 understood them, accepted them, or will ever show them in a report. A typo in your API secret returns success. An event named 1purchase returns success. A payload missing required fields returns success. This single fact is behind the majority of “my events return 200 but never show up” threads - people watch for an error that the API is structurally incapable of returning.
How to actually validate a payload
Because the production endpoint is silent, you must validate against the debug endpoint, which the production one is not:
POST https://www.google-analytics.com/debug/mp/collect?measurement_id=G-XXXXXXXX&api_secret=YOUR_SECRET
The debug endpoint returns a validationMessages array describing exactly what is wrong - with a fieldPath, a human-readable description, and a validationCode such as NAME_INVALID, NAME_RESERVED, VALUE_REQUIRED, or VALUE_OUT_OF_BOUNDS. Two caveats from Google’s own docs: events sent to the validation server do not show up in reports, and the validation server does not check your api_secret - so a passing debug response with a wrong secret will still fail silently in production. Use the debug endpoint to fix structure, then confirm a real event lands in GA4 → Admin → DebugView or Realtime.
That validate-first discipline is the difference between “I’m sending events and praying” and knowing they are accepted.
One more verification note: DebugView and Realtime are convenient but not authoritative - they can suppress events from a client_id they do not recognize and apply their own thresholds, so an event can be processing fine yet not appear there. If you have the BigQuery export enabled, the raw events table is the most reliable place to confirm what GA4 actually ingested.
Reason 1: Missing session_id and engagement_time_msec
This is the most common reason events are accepted but never appear in standard reports. Google states it directly:
To ensure accurate session and user engagement metrics in your reports, including Realtime, include the
session_idandengagement_time_msecparameters with your events.
Without them, “events sent without these parameters may still appear in some reports, but they won’t contribute correctly to metrics like Average engagement time or Engaged sessions.” In practice that means an event that technically ingested but never produces an engaged session, never shows a user in Realtime the way you expect, and quietly fails to behave like real traffic.
The rules:
session_idmust be a positive number - it has to match the regular expression^\d+$. Send the samesession_idfor events in the same session, and a new value starts a new session (you do not need to sendsession_startyourself).engagement_time_msecshould carry a sensible engagement time in milliseconds. A small positive value (for example100) is enough to register engagement on a server event that has no real on-page dwell time.
Send both on every Measurement Protocol event. There is no downside, and omitting them is the single biggest cause of “it ingested but I can’t find it.”
Reason 2: Mismatched client_id - Ghost Sessions and (not set)
The client_id is the pseudonymous device identifier that ties events to a user. Google says it “should match the ID generated by the Google Analytics tag on your website” - the client ID GA4 stores in the visitor’s first-party _ga cookie.
Here is what goes wrong: if your server generates its own random client_id instead of reusing the one already in the _ga cookie, GA4 treats the server event as a brand-new, unrelated user. You get what practitioners call ghost sessions - extra sessions with no page context that report their source as “(not set) / (not set)” or collapse into “Direct” / “(none)”, inflating your user and session counts while destroying attribution. The campaign that actually drove the purchase gets no credit.
The fix is to read the existing GA4 client ID out of the _ga cookie and send that exact value from the server, so the server event joins the same user journey the browser already started. Reuse the browser session’s identifier too, so the server event lands inside the correct session rather than spawning a new one. Without this stitching, server-side GA4 actively makes your data worse than browser-only tracking. With it, the server event is just a continuation of the real user.
Two cookie details trip people up here, because the two identifiers live in two different cookies:
- The client ID is in
_ga, but the raw value carries a prefix (it is not just the bare ID). You must extract the client-ID portion and send that - sending the whole cookie string, or stripping the prefix incorrectly, produces aclient_idGA4 cannot match, which is a documented cause of every server event showing up as “Direct.” - The session ID is not in
_ga- it lives in a separate per-property_ga_<MEASUREMENT_ID>cookie. This catches almost everyone. And that cookie’s internal format was changed in 2025, so any server code that parsed the session ID out of it by dot-position silently broke. Read it defensively, not by fixed offset.
It also helps to know what the symptom is actually telling you, because the three look similar but have different fixes: direct / (none) is a real session GA4 could not find a referrer for; (not set) / (not set) means GA4 has no source data at all for the event - the classic mismatched-identifier failure; and Unassigned means a source exists but matched no channel rule. If your server events land in “(not set),” you have a stitching problem, not a channel-grouping one.
If you have authenticated users, also send a top-level user_id (not as a user property - user_id is reserved there) to connect behavior across devices and de-duplicate users. Audience use cases additionally require the Measurement Protocol event to reference the same client_id as your online events, within 30 days of the latest online event.
Reason 3: Reserved or Invalid Event Names
GA4 silently rejects or sidelines events whose names break its rules. Event names must:
- start with a letter,
- use only letters, numbers, and underscores (no spaces),
- stay within 40 characters,
- avoid the reserved prefixes
_,firebase_,ga_,google_, andgtag., - and avoid GA4’s reserved event names.
Reserved names that you must not reuse for your own events include session_start, first_visit, user_engagement, app_remove, first_open, and error, among others. (The standard ecommerce names like page_view, view_item, add_to_cart, begin_checkout, and purchase are the correct ones to send - they are recommended events, not forbidden ones.)
There is a subtler trap on top of the hard rules: undocumented (custom) event names are accepted, but they will not appear in standard reports until you register them as custom events/dimensions in the GA4 admin. So an event can pass validation, ingest successfully, and still be effectively invisible in the reports you actually look at. If you are inventing event names, either map them to GA4’s recommended events or expect to do explicit configuration before they surface.
Other limits worth respecting: a maximum of 25 events per request, 25 parameters per event, parameter names up to 40 characters, and parameter values up to 100 characters. Overflowing these gets the offending pieces dropped.
Reason 4: Timestamps in the Wrong Unit or Too Old
The Measurement Protocol’s optional timestamp_micros field is a Unix timestamp in microseconds - not milliseconds, and not seconds. Send milliseconds and your event lands far in the past or future. Two more rules that bite server-side and backend integrations specifically:
- 72-hour backdating limit. Events can be backdated at most 72 hours. In the default (relaxed) mode, a timestamp older than 72 hours is silently clamped to exactly 72 hours ago; in enforcing mode, the event is rejected outright.
- 48-hour attribution window. Separately from the backdating limit, events should reach GA4 within roughly 48 hours for conversion attribution to be accurate.
This matters most for genuinely server-originated events - a refund, a delayed payment capture, a subscription renewal reconciled by a nightly job. If your batch runs slowly or retries over days, those events can age out of the window and either lose their real timestamp or never attribute. Send promptly, and never hand-roll the timestamp in the wrong unit.
Reason 5: Double-Counted Purchases
If you run the gtag browser tag and send the same purchase server-side, GA4 will not magically know they are the same event. Google is explicit that it “doesn’t automatically detect or remove duplicate” events across sources. The result is doubled revenue and purchase counts.
The mechanism that prevents this for ecommerce is the transaction_id: it is the field GA4 uses to avoid duplicate purchases, so the rule is to send the identical transaction_id from both the browser tag and the server event for the same order. Mismatched or missing transaction IDs are what turn a healthy hybrid setup into an inflated one.
Two caveats save real money here. First, this transaction_id collapsing happens in GA4’s standard reports - if you export to BigQuery, the raw event table still contains both events, so any revenue query you run there must deduplicate on transaction_id yourself or you will double-count in your own dashboards. Second, on Shopify specifically, the Google & YouTube (Google Sales Channel) app installs its own GA4 tracking that fires purchases independently of whatever you set up - a very common source of doubling that has nothing to do with your server integration. Audit for a second GA4 tag before blaming the Measurement Protocol. (If your Meta numbers are also doubled, that is a related but separate problem - see Facebook CAPI Deduplication.)
Reason 6: The Blind Spots of Server-Only Data
Even when everything ingests correctly, Measurement-Protocol-only data has documented limitations you should set expectations around:
- Geo and device are not invented by the server. GA4 joins the most recent geographic and device information from your tagging to Measurement Protocol events using the
client_id. If there is no browser tag for that user, there is no automatic geo or device data (you can supply location and device fields manually, but most setups should keep a browser tag running so the join happens for you). - Remarketing audiences have conditions. Same-device remarketing requires Google Signals to be on; cross-device requires a
user_id. Server events alone do not guarantee audience eligibility. - Event-modification rules do not fire. GA4’s “modify/create event” rules are not triggered by Measurement Protocol events.
- Rate limits drop silently. Exceed the per-property request ceiling and the excess is dropped with - you guessed it - no error.
The takeaway: server-side GA4 is for recovering and completing your data (purchases the browser tag lost to ad blockers, consent gating, and iOS privacy, plus backend-only events), not for replacing the browser tag entirely. The two are designed to work together. For the bigger picture on why the browser tag loses so much, see Why Server-Side Tracking Matters and our signal loss explainer.
Don’t Forget Consent
GA4 accepts a top-level consent object on Measurement Protocol payloads with ad_user_data and ad_personalization, each set to GRANTED or DENIED (this replaces the deprecated non_personalized_ads boolean). Send it honestly, reflecting the visitor’s actual consent state - both for compliance and because it governs how the data may be used for advertising.
The Fix: A Hybrid, Stitched, Validated Setup
Every gotcha above resolves into one coherent architecture:
- Run gtag and the Measurement Protocol together, not server-only - so geo, device, and engagement signals keep flowing and the server merely completes the picture.
- Reuse the
_gacookie’sclient_id(and the existing session identifier) on every server event, so events stitch to the real user and session instead of spawning ghost sessions. - Always send
session_idandengagement_time_msecso events appear in Realtime and count toward engaged sessions. - Use valid, recommended event names within the naming rules, and register any custom events you actually need.
- Send
timestamp_microsin microseconds, within 72 hours, and dispatch backend events promptly. - Send a consistent
transaction_idfrom browser and server for every purchase, so GA4 collapses the duplicate. - Send the
consentobject matching the user’s real choices. - Validate against the debug endpoint and confirm in DebugView - never trust the silent
2xx.
Done by hand, that is a substantial build: extracting the GA4 client ID from the cookie, carrying it and the session ID server-side, attaching engagement and timestamp fields correctly, mapping your events to GA4’s recommended names, coordinating transaction IDs across browser and server, threading consent through, and validating continuously. Every step is a place server-side GA4 silently breaks.
How AxiTrace Solves This by Design
AxiTrace implements that whole chain so GA4 reports match reality. GA4 is one of the 9 destinations of the AxiTrace Conversion API, so the same order also reaches the ad platforms you connect:
- It sends events to GA4 through the Measurement Protocol with your Measurement ID and API secret, and always includes
session_idandengagement_time_msecon every event - so events show in Realtime and count as engaged sessions instead of ingesting into the void. - It reuses the GA4
client_idfrom the visitor’s_gacookie (and the browser session identifier) so server events stitch to the same user and session - no ghost sessions, no “(not set)” attribution explosion. When no cookie value is available it derives a stable, consistent identifier rather than a fresh random one each time. - It maps your store’s events to GA4’s recommended event names (
page_view,view_item,add_to_cart,begin_checkout,add_payment_info,purchase,refund, and more), so they appear in standard reports without custom wiring. - It sends the same
transaction_idfrom the server that the browser tag uses, and coordinates with the gtag layer so purchases are counted once, not doubled. - It forwards the Consent Mode signals (
ad_user_data,ad_personalization) on the payload, and sends timestamps in the correct unit and window. - The same purchase, from one ingestion point, also reaches Meta CAPI and Google Ads - so every platform agrees.
- Native plugins for Shopify, WooCommerce, Magento, and Shopware wire it up without touching gtag or theme code.
See GA4 server-side tracking for the full picture.
Getting Started
- Install the plugin for your platform - the Shopify App Store, WordPress.org for WooCommerce, or Packagist for Magento and Shopware.
- Connect GA4 in the AxiTrace dashboard with your Measurement ID and an API secret generated in GA4 Admin → Data Streams → your stream → Measurement Protocol API secrets.
- Fire a few real events, then open GA4 → Admin → DebugView and Realtime - you should see events stitched to real sessions, not a pile of “(not set)” ghosts.
- Reconcile your GA4 purchase count against your store’s orders after 24-48 hours (standard reports lag); the gap should close.
The free tier covers 10,000 visits per month, enough to confirm your server-side GA4 events actually appear - correctly attributed - before committing to a paid plan. The real-time dashboard shows which events reached GA4, Meta, and Google Ads, so you can watch it work without leaving AxiTrace.
Frequently Asked Questions
Why do my GA4 Measurement Protocol events return 200/success but never appear?
Because a 2xx response only confirms the request was received - Google’s docs state the endpoint does not return an error for malformed, incorrect, or unprocessed payloads. The usual culprits are a missing session_id/engagement_time_msec, an invalid or reserved event name, a wrong API secret, or a custom event name that ingests but is not registered for standard reports. Validate against the debug/mp/collect endpoint and confirm in DebugView rather than trusting the success code.
What causes ghost sessions and “(not set)” traffic in GA4 server-side tracking?
A mismatched client_id. If the server sends its own random client_id instead of the value from the visitor’s _ga cookie, GA4 treats the event as a new, unrelated user and session - producing extra sessions reported as “(not set) / (not set)” or “Direct”. Reuse the existing _ga client ID and the browser’s session identifier so server events stitch to the real user.
Are session_id and engagement_time_msec required?
The API will accept events without them, but per Google they are needed for events to behave correctly in reports including Realtime and to count toward Engaged sessions and Average engagement time. Practically, treat both as mandatory on every Measurement Protocol event. session_id must be a positive integer matching ^\d+$.
Does the Measurement Protocol deduplicate purchases against the gtag browser tag?
GA4 does not automatically detect or remove duplicate events across sources. For ecommerce, transaction_id is the field used to avoid duplicate purchases, so send the identical transaction_id from both the browser tag and the server event for the same order. Mismatched or missing transaction IDs are the usual cause of doubled revenue.
How far back can I send events with timestamp_micros?
Up to 72 hours. The value is a Unix timestamp in microseconds (not milliseconds). In relaxed mode, timestamps older than 72 hours are clamped to 72 hours ago; in enforcing mode they are rejected. There is also a separate ~48-hour window for accurate conversion attribution, so dispatch backend events like refunds promptly.
Can I run GA4 server-side only and drop the browser tag?
You can, but you lose things GA4 derives from tagging: automatic geo and device data are joined to Measurement Protocol events via client_id from your tagging, and remarketing audiences depend on Google Signals or a user_id. The recommended setup is hybrid - keep gtag for browser signals and use the Measurement Protocol to recover lost purchases and backend-only events, with a shared client_id and transaction_id tying them together.
Why does GA4 report fewer purchases than my store?
The browser tag is blocked or never runs for a large share of users - ad blockers, consent rejection, and iOS privacy all suppress gtag - so those purchases never reach GA4. Sending Purchase events server-side via the Measurement Protocol (correctly stitched and deduplicated) recovers them and closes the gap, which is why server-side tracking makes GA4 trustworthy as a source of truth again.