GA4 Measurement Protocol: Server-Side CRM Offline Conversion Integration
Part 5 of 6 in the series From pixel to server: tracking that holds

Contents
GA4 Measurement Protocol: Server-Side CRM Offline Conversion Integration
Connecting offline conversions from CRM and POS systems with online user journeys represents a cornerstone of enterprise digital analytics. Relying solely on browser-based tracking leaves conversion data incomplete whenever sales close via phone, email, or in physical retail stores. Utilizing the Google Analytics 4 (GA4) Measurement Protocol enables direct, server-to-server HTTP POST requests that bridge this gap and attribute revenue accurately to original marketing touchpoints.
1. The Identity Resolution Architecture: client_id, session_id, and user_id
Flawless attribution requires precise identity resolution. When sending offline events via Measurement Protocol, GA4 must link incoming backend payloads to an existing web session. This relies on three foundational parameters:
- client_id (Required): The anonymous browser identifier generated by the GA4 cookie (
_ga). This value must be captured during form submissions and stored persistently within CRM lead records. - session_id (Crucial for Session Attribution): Passing only the
client_idattributes an offline conversion to the user, but GA4 will often categorize the traffic source as Unassigned or create a synthetic direct session. To inherit the original traffic source (e.g., Google Ads, Organic Search), the numericga_session_idmust be captured from the browser and passed inside theparamsobject. - user_id (Optional, Cross-Device): When authenticated user systems are active, passing a permanent internal database ID enables cross-device journey stitching across web, mobile apps, and offline POS transactions.
2. Structuring the HTTP POST Payload
Server-side transactions must be transmitted to the official collection endpoint: https://www.google-analytics.com/mp/collect. Authentication requires a valid api_secret generated inside the GA4 data stream settings along with the measurement_id in the format G-XXXXXXX.
The following JSON payload illustrates a compliant offline purchase event containing all required attribution parameters:
POST /mp/collect?measurement_id=G-XXXXXXX&api_secret=abc123XYZ HTTP/1.1
Host: www.google-analytics.com
Content-Type: application/json
{
"client_id": "1234567890.1700000000",
"user_id": "CRM_LEAD_998877",
"timestamp_micros": "1723795200000000",
"non_personalized_ads": false,
"events": [
{
"name": "purchase",
"params": {
"session_id": "1700000000",
"transaction_id": "CRM_INV_2026_0891",
"value": 1499.00,
"currency": "EUR",
"engagement_time_msec": 100,
"items": [
{
"item_id": "SKU_ENTERPRISE_PLAN",
"item_name": "Enterprise Service License",
"price": 1499.00,
"quantity": 1
}
]
}
}
]
}
3. Managing Attribution Delays and Timestamp Constraints
Offline CRM transactions rarely occur instantly. Sales cycles often span days or weeks after the initial website inquiry. Handling attribution delays correctly requires adhering to GA4 processing limitations:
- The 72-Hour Window: The standard GA4 Measurement Protocol enforces a strict latency rule. Events sent with a
timestamp_microsvalue older than 72 hours (3 days) in the past may be rejected or dropped by standard real-time processing pipelines. - Real-Time CRM Webhooks vs. Nightly Batches: Due to the 72-hour constraint, relying on weekly or monthly batch uploads is discouraged. Implementing event-driven webhooks inside CRM systems (e.g., triggering a POST request immediately when an opportunity stage changes to Closed Won) ensures timestamps remain fresh and valid.
- Historical Lookfill via BigQuery: For complex B2B sales cycles exceeding 72 hours, data integration should occur downstream within Google Cloud BigQuery. Joining historical CRM transaction tables directly with raw
events_*web data usingclient_idand lead creation timestamps provides 100% attribution accuracy without API time limit restrictions.
Summary
Integrating offline CRM conversions via the GA4 Measurement Protocol transforms reporting precision. Ensuring that client_id and session_id are stored during lead capture, formatting structured JSON payloads, and transmitting events within the 72-hour window guarantees reliable cross-channel attribution.
From pixel to server: tracking that holds
- The Evolution of Web Tracking: From Log Files to the Server-Side Future
- How to Implement Google Tag Gateway
- GA4 & Server-Side GTM: The “Migrate from JavaScript Managed Client ID” Feature Explained
- Server-Side GTM on GCP Cloud Run: Architecture, Auto-Scaling, and Cost Optimization
- GA4 Measurement Protocol: Server-Side CRM Offline Conversion Integration
- Meta Conversions API: Maximizing Event Match Quality (EMQ) and Deduplication
2 comments
The recommendation to use webhooks rather than nightly batches follows directly from the 72-hour rule, and it is the part that changes how the CRM side has to be built rather than just the tracking side.
What I cannot find documented: what happens to an event that fails and gets retried past the window? Our queue backs off for hours on a bad day.
It is not processed, and nothing says so. The Measurement Protocol endpoint answers with a success status regardless of what it does with the payload — there is no rejection to catch, no error body to log, and a retry loop will happily keep succeeding on events that no longer land anywhere.
That has two consequences for the client. The window has to be treated as a hard expiry inside the client itself: an event older than the limit is dropped deliberately and counted, rather than retried until the queue drains. And the counter of dropped events is the actual health signal for the integration, because the transport layer will never produce one.
The one place where validation exists is the debug endpoint,
/debug/mp/collect, which returns the validation messages the normal endpoint withholds. It belongs in the test suite of the pipeline rather than in production traffic — a malformed payload that silently succeeds in production is otherwise indistinguishable from a correct one until someone notices the reports are missing revenue.