ga4-measurement-protocol

Send server-side GA4 events via the Measurement Protocol with validation and retry logic.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, ga4mp, and includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill covers GA4 Measurement Protocol for server-side tracking, including API secrets, endpoint usage, and server-side event design.

Core Features & Use Cases

  • Endpoint & Authentication: Production and debug endpoints with API secrets.
  • Payload Design: Client ID, user properties, and events payload formats.
  • Server-Side Use: Back-end integrations, CRM, and offline conversion tracking.

Quick Start

Generate a measurement protocol secret, craft a JSON payload with a page_view event, and POST it to the mp collect endpoint.

Frequently Asked Questions about ga4-measurement-protocol

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

FAQPage Schema
How do I send GA4 events from my backend server instead of the client?

Server-side GA4 tracking uses the Measurement Protocol to POST events directly to Google Analytics from your backend. This enables tracking from payment processors, CRM systems, form handlers, and offline conversions where client-side tracking isn't possible, using your measurement ID, API secret, and client ID in the payload.

What's required to set up GA4 Measurement Protocol authentication?

Generate a measurement protocol API secret in your GA4 property, then include it with your measurement ID and client ID in each POST request to the collect endpoint. Authentication is secret-based and endpoint-specific, supporting both production and debug endpoints for testing before going live.

Can I track offline conversions and CRM events in GA4?

Yes, the Measurement Protocol enables server-side tracking of offline conversions, CRM integrations, and backend events by sending structured JSON payloads with user properties, event names, and timestamps directly to GA4 without requiring client-side instrumentation.

What payload constraints apply when formatting GA4 Measurement Protocol requests?

Event names must not exceed 40 characters, requests can include up to 25 events per batch, and payloads require client_id or user_id, measurement_id, API_secret, and properly formatted events arrays with user properties and consent signals for compliance.

How do I handle rate limits and errors with GA4 server-side tracking?

Implement retry logic and rate-limit handling in your backend to manage API responses when batching events via Measurement Protocol. The Skill covers error handling strategies to ensure reliable delivery of server-side events to GA4.

Does Measurement Protocol work with headless CMS and backend form submissions?

Yes, Measurement Protocol is designed for headless CMS platforms, backend form processors, and any server-side system that needs to track events without client-side JavaScript, using standard HTTP POST requests with validated JSON payloads.