Definition
The Measurement Protocol accepts events at a single POST endpoint with two required identifiers: the Measurement ID of your GA4 property and an API secret generated inside the GA4 admin. Each request carries a client_id (matching the gtag client_id when possible, so the server event joins the same user journey), optional user_id, and one or more events with parameters like value, currency and items[]. GA4 ingests these alongside browser events and applies the same processing - deduplicating, attributing and reporting. Compared to GA4's predecessor Universal Analytics, the Measurement Protocol is stricter: undocumented event names work but they will not appear in standard reports without explicit configuration.
Why it matters
Without server-side events, GA4 typically reports 30-50% fewer purchases than your store actually fulfilled, because gtag.js is blocked or never executes for a large share of users. That gap shows up as 'GA4 disagrees with Shopify' or 'my conversion rate looks low' - but the conversions did happen. Sending Purchase events server-side via the Measurement Protocol closes the gap and makes GA4 reports trustworthy again, which matters if you use GA4 as the source of truth for ROAS, attribution or executive reporting.
Frequently asked questions
Does the Measurement Protocol replace gtag.js?
No. Best practice is to run both with matching client_id so they join the same user. gtag.js handles browser-side signals (page_view, scroll, engagement) that the server cannot easily produce; the Measurement Protocol recovers events that gtag misses or that originate purely server-side, like refunds.
How do I avoid double-counting purchases in GA4?
Coordinate the gtag and server events to use the same transaction_id. GA4 deduplicates events with identical transaction_id and event timestamp window for ecommerce events. Sending the same purchase from both browser and server with the same transaction_id results in one counted conversion.