Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

GA4 Measurement Protocol Request Generator

Send server-side events to Google Analytics 4. Choose the event and parameters, and get a ready Measurement Protocol request as curl, Node.js, PHP or Python — with a switch for the validation server that reports mistakes.

Mis à jour le

Items

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : GA4 Measurement Protocol Generator

  1. Create an API secret in GA4: Admin → Data streams → your stream → Measurement Protocol API secrets.
  2. Enter the measurement ID and secret, then pick the event and parameters.
  3. Turn on the validation server, run the request and fix anything it reports.
  4. Turn validation off and send real events from your server.

When to use the Measurement Protocol

It records things the browser never sees: a renewed subscription, a refund, a phone sale or a webhook from your payment provider. Send the visitor’s client_id (from the _ga cookie) so the event joins their session, and session_id if you want it in the same session. The validation endpoint returns problems as JSON and records nothing; the real endpoint always answers 204, even for bad data. Keep the API secret on your server — anyone with it can send data to your property.

Aussi recherché comme : ga4 measurement protocol, measurement protocol generator, ga4 server side events, mp collect, ga4 api secret, measurement protocol curl, ga4 offline conversions.

Outils complémentaires : GA4 Measurement Protocol Generator

  • GA4 Event Code Generator — Pick a recommended GA4 event — generate_lead, sign_up, purchase, add_to_cart and more — or name your own, fill in the parameters and items, and copy the code as gtag(), a Tag Manager dataLayer.push() or a server-side Measurement Protocol request.
  • cURL to Code — Paste a curl command — from API docs or “Copy as cURL” in your browser’s DevTools — and get ready-to-run code for six languages, with headers, body and authentication carried over.
  • API Tester — A lightweight Postman alternative in your browser: build an HTTP request, send it and inspect status, timing, headers and pretty-printed JSON.
  • GA4 Request Decoder — Debug Google Analytics 4 without guesswork.

Questions fréquentes

Why does the collect endpoint return 204 for everything?
The production endpoint never reports errors. Send the same body to /debug/mp/collect to see validation messages.
How soon do Measurement Protocol events appear?
Usually in Realtime within a minute; standard reports can take up to a day or two.
Can I send events without a website visit?
Yes, but you still need a client_id. Use your own stable ID per customer; those events start their own sessions instead of joining a web visit.
Puis-je installer GA4 Measurement Protocol Generator en tant qu’application web et l’utiliser hors ligne ?
Oui. GA4 Measurement Protocol Generator est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires