ga4-measurement-protocol-api-guide

Send GA4 Measurement Protocol requests with JSON payloads from backend systems.

77|9|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/henkisdabro/claudecode-marketplace --skill ga4-measurement-protocol-api-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ga4-measurement-protocol-api-guide
Source: https://github.com/henkisdabro/claudecode-marketplace/tree/main/ga-suite/skills/ga4-measurement-protocol/references/complete-api-guide.md
Command: npx skills add https://github.com/henkisdabro/claudecode-marketplace --skill ga4-measurement-protocol-api-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This reference provides a complete API guide for GA4 Measurement Protocol, including endpoints, payload fields, and sample requests for common events.

Core Features & Use Cases

  • Endpoint Usage: mp.collect production and debug endpoints.
  • Payload Schema: Field-by-field guidance for client_id, user_id, events, and user_properties.
  • Sample Payloads: Ready-to-copy request bodies for common scenarios.

Quick Start

Build a page_view event with a transaction_id and items array, then send to the GA4 MP endpoint.

Frequently Asked Questions about ga4-measurement-protocol-api-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send server-side events to GA4 using the Measurement Protocol?

Server-side event collection with GA4 Measurement Protocol requires sending POST requests to the mp.collect endpoint with your measurement_id and api_secret for authentication, plus a JSON payload containing client_id, events array, and optional user properties. This enables backend systems to submit events directly without client-side tracking.

What authentication credentials do I need for GA4 Measurement Protocol API requests?

GA4 Measurement Protocol requires two credentials: your measurement_id (which identifies your GA4 property) and api_secret (generated in GA4 settings). Both must be included in every POST request to authenticate server-side event submissions.

Can I track offline conversions and CRM data in GA4?

Yes. GA4 Measurement Protocol enables offline conversion tracking by accepting server-side requests from CRM systems, payment processors, and form backends. Send structured events with transaction data, items arrays, and user identifiers to integrate offline sales and leads into GA4.

What's the correct payload structure for GA4 Measurement Protocol requests?

Measurement Protocol payloads require client_id, an events array with event names and parameters, and optional user_properties. Events can include transaction_id, items arrays, and custom parameters. The JSON structure must post to mp.collect with measurement_id and api_secret for validation.

How do I handle rate limits and retries with GA4 Measurement Protocol?

GA4 Measurement Protocol enforces rate limits on server-side requests. Implement retry logic with exponential backoff for failed submissions, monitor response status codes, and batch events efficiently to stay within quota while ensuring reliable event delivery from backend systems.

Does GA4 Measurement Protocol work for form submissions and lead capture?

Yes. Measurement Protocol supports form lead events by accepting POST requests from backend form handlers. Structure events with lead parameters and user identifiers to track form submissions, lead quality, and conversion attribution directly from your server without relying on client-side pixels.