Free auditStart free
GlossaryGlossary · Measurement

Measurement Protocol

The GA4 Measurement Protocol sends events to Google Analytics over HTTP from servers and offline systems. Request anatomy, limits and a validation check.

2 min
read
4
sources
Nov 1, 2026
updated
Scaplet Editorial Team
author
In one line

The Measurement Protocol is a set of HTTP endpoints for sending events straight to Google Analytics servers, mainly from servers and offline systems. Google says it is meant to augment gtag, Tag Manager or Firebase collection, not replace it.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode

At a glance

5 facts from the sources below
HTTP POST only
Method
www.google-analytics.com/mp/collect
Endpoint
25 maximum
Events per request
Under 130 kB
Post body
Collect endpoint returns no HTTP error codes
Errors
01At a glance

Anatomy of a request

A web-stream request carries the stream's measurement ID and an API secret in the URL and a client ID plus events in the JSON body. Values below are placeholders.
Part

api_secret

Job
Created under Admin, Data Streams, your stream, Measurement Protocol, Create
Part

client_id

Job
Joins the event to an online interaction and carries its privacy settings
Part

events

Job
Array of event objects, each with a name and optional params
Part

session_id (optional)

Job
Ties the event to a session if sent within 24 hours of the session start
Web stream request
POST /mp/collect?measurement_id=G-XXXXXXXXXX&api_secret=SECRET HTTP/1.1
Host: www.google-analytics.com
Content-Type: application/json

{
  "client_id": "555.1234",
  "events": [
    { "name": "level_up", "params": { "level": 5 } }
  ]
}

EU data collection uses the host region1.google-analytics.com. The validation check below exercises the web URL shape shown above.

02Your call

When to use it, and when not

If this fits

Use it for

  • Offline conversions and server-to-server events
  • Devices without automatic collection, such as kiosks
  • Joining online and offline behavior using the same client_id
Or

Do not use it as

  • The only collection method: Google says full server-to-server use may give partial reporting
  • A replacement for client tagging, since you still need gtag, Tag Manager or Firebase
  • A place to rely on event rules: rules that generate or rename events do not apply to these events
04Check it

Check it in 2 minutes

Send a deliberately bad event to the validation endpoint. The response lists problems; an empty validationMessages array means none were found. Events sent here do not appear in reports, and the validator does not check your api_secret.

To check your real stream, replace the placeholders. Keep the debug path until the response is clean, then switch to /mp/collect for production.

Validate an event
curl -s -X POST 'https://www.google-analytics.com/debug/mp/collect?measurement_id=G-XXXXXXXXXX&api_secret=test' \
  -H 'Content-Type: application/json' \
  -d '{"client_id":"555.1234","events":[{"name":"_badEventName","params":{}}]}'
# prints a validationMessages array with code NAME_INVALID.
# Change the name to level_up and it prints an empty array.
Questions

Asked a lot.

2 questions people ask next, answered from the sources on this page.

01Does the Measurement Protocol replace gtag?

No. Google says it augments automatic collection through gtag, Tag Manager and Google Analytics for Firebase.

02Why did my event not appear and I got no error?

The collect endpoint returns 2xx on receipt and no HTTP error for bad data. Send the same payload to the validation endpoint to see the reason.

Sources · 4

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • google.com
  1. 01Measurement Protocol overviewdevelopers.google.com · checked 2026-11-01
  2. 02Send eventsdevelopers.google.com · checked 2026-11-01
  3. 03Measurement Protocol referencedevelopers.google.com · checked 2026-11-01
  4. 04Validate eventsdevelopers.google.com · checked 2026-11-01
Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly