The Measurement Protocol is an API that lets your server send events straight to GA4 over HTTP, without a browser or the gtag script.
You send a POST request to Google's endpoint with your measurement ID, an API secret, a client ID, and the event payload. GA4 treats those events like any other hit. This is how you record things that happen where no page is loading: a refund processed in your backend, a subscription renewal, a lead scored in your CRM hours after the click.
Take a checkout that finishes on a hosted payment page you do not control. The browser never returns to fire a purchase event, so your server catches the payment webhook and sends a Measurement Protocol call with the transaction value and the stored client ID. The purchase now shows up against the right session.
The client ID is the part people botch. If you generate a random one instead of passing the real value the browser already assigned, the event lands as a brand-new user with no source, and your attribution silently breaks.
It puts server-side events into GA4, and stitches them badly if you are careless.
Sources
- developers.google.com · verified August 2026
- support.google.com · verified August 2026
Last checked 9th August 2026. Next check 15th August 2026.
