GA4 Measurement Protocol Builder
Build and validate GA4 Measurement Protocol payloads — useful for server-side events, offline imports, and CRM-to-GA4 pipelines.
Inputs
The GA4 cookie value (_ga). For server-side, generate or look up.
Use dot/bracket notation for nesting: items[0].item_id.
Payload (POST body)
{
"client_id": "1234567890.1620000000",
"events": [
{
"name": "page_view",
"params": {
"page_location": "https://example.com",
"page_title": "Home"
}
}
]
}cURL command
curl -X POST "https://www.google-analytics.com/mp/collect?measurement_id=G-XXXXXXXXXX&api_secret=YOUR_API_SECRET" \
-H "Content-Type: application/json" \
--data '{"client_id":"1234567890.1620000000","events":[{"name":"page_view","params":{"page_location":"https://example.com","page_title":"Home"}}]}'Validation tip: Append ?validation to the URL hostname (/debug/mp/collect) to test before sending real events.
