Skip to content

Server-side events · Platform reference

GA4 Measurement Protocol: events, fields and dedup rules

The GA4 Measurement Protocol lets a server POST events to a GA4 web stream (measurement_id + api_secret) or app stream, joined to the visitor through the client_id that the Google tag created. It's meant to add to tagging, not replace it. Events arrive but show up as unassigned or (not set), or never reach linked ad platforms, when client_id or session_id don't come from the real tag, when the event is sent after the session or export windows, or when the payload is malformed: the production endpoint returns no HTTP errors.

Read from the official documentation on 9 November 2026. Sources are listed at the end.

Endpoint and authentication

POST https://www.google-analytics.com/mp/collect?measurement_id={MEASUREMENT_ID}&api_secret={API_SECRET} (EU: region1.google-analytics.com)

api_secret query parameter (a Measurement Protocol API secret for the data stream) plus measurement_id; app streams use firebase_app_id instead

Standard event names

Spelled exactly as Google Analytics 4 expects them. A near miss is treated as a different event.

EventUse it for
purchaserecommended event; transaction_id and items required, value typically required, currency required when value is set
refundrecommended online-sales event
begin_checkoutrecommended online-sales event
add_to_cartrecommended online-sales event
add_payment_inforecommended online-sales event
add_shipping_inforecommended online-sales event
view_itemrecommended online-sales event
sign_uprecommended for all properties
loginrecommended for all properties
searchrecommended for all properties
session_start / first_visit / user_engagementRESERVED: can't be sent via Measurement Protocol

Required and recommended fields

FieldWhat it needs
api_secretQuery parameter; the validation server does not check it
measurement_idQuery parameter for web streams
client_idBody. For web streams it should match the ID the Google Analytics tag generated on your site
events[].name40 characters or fewer, alphanumeric; reserved names rejected
events[].params.session_idNeeded to attribute the event to a session; must be a positive number from the client-side tag
events[].params.engagement_time_msecRecommended alongside session_id, or engagement metrics are off
timestamp_microsOptional Unix microseconds; can backdate up to 72 hours
consent.ad_user_data / consent.ad_personalizationGRANTED or DENIED; non_personalized_ads is deprecated in favour of consent.ad_personalization
user_idOptional; needed for cross-device remarketing
validation_behaviorRELAXED (default) or ENFORCE_RECOMMENDATIONS

Match keys and hashing

KeyNormalise and hash
client_idNot hashed. Read the value the Google tag generated
user_idNot hashed. Your own UTF-8 user ID
user_dataUser-provided data object (field-level rules not covered on the pages fetched)
ip_override / user_location / deviceNot hashed. Used for geo and device; user_location takes precedence over ip_override

Click ids

Click idWhere it comes from
GBRAID / WBRAID (via the client_id join)Measurement Protocol events are joined to online interactions by client_id (or app_instance_id), and advertising identifiers such as GBRAID/WBRAID carry over through that join. The MP reference lists no click-ID field on the event itself

Deduplication

Time limits and batch sizes

How to test before you trust it

Why events arrive but don't attribute

Sources

Platforms change these rules without notice. If a source says something different from this page, the source wins.

Other platforms

All platforms