GA4 Measurement Protocol: the limits that silently drop your events
Payload limits, the 72-hour rule, session stitching with client_id and session_id, and why GA4 returns 2xx for invalid events.
The Measurement Protocol lets a server send events to Google Analytics 4. It is simple to call and easy to get silently wrong, because the collection endpoint answers with a success status even when it discards what you sent.
Validate with the debug endpoint
Send the same body to /debug/mp/collect to get validationMessages back. RELAXED validation (the default) reports real errors. ENFORCE_RECOMMENDATIONS also turns recommended fields into errors. For example, once a device object is present it demands device.model, which a desktop browser cannot provide.
Limits worth enforcing before you send
- Up to 25 events per request and 25 parameters per event.
- Event and parameter names up to 40 characters; parameter values up to 100 characters.
- timestamp_micros at most 72 hours in the past. Older events are rejected.
- Parameter names may not start with _, firebase_, ga_, google_ or gtag.
Make server events join the browser session
Use the client_id from the _ga cookie and the session id from the _ga_<container> cookie, and include engagement_time_msec. Without them, server events appear as separate users and sessions, and may not show in standard reports.
Deduplicating purchases
GA4 deduplicates purchases with the same transaction_id, so always set it to your order id. It is the safety net if a purchase is ever sent twice.
Sources
Try it on your store
Trakero applies all of this for you: first-party SDK, server-side delivery to Meta, TikTok, GA4, Snapchat and Pinterest, deduplication by order id, and a debugger that explains every event.
Start free