IntegrationsAnalyticsGoogle Analytics 4 (Collect)

Google Analytics 4 (Collect)

Server-side event delivery to Google Analytics 4 via the /collect endpoint, mirroring the client-side gtag.js payload format.

Configuration

FieldTypeRequiredDescription
measurement_idstringYesThe Measurement ID for your GA4 web data stream. Found in Admin > Data Streams > Web.
api_secretsecretYesMeasurement Protocol API secret. Create one in Admin > Data Streams > Measurement Protocol API secrets.
client_id_fieldstringYesThe event property name that contains the GA4 client ID (e.g. from the _ga cookie). Used to associate server-side events with the correct user session.

Quick Setup

  1. Navigate to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Google Analytics 4 (Collect) or filter by Analytics.
  4. Click Install, select a variant if available, and fill in the required fields.
  5. Click Install Integration to create the integration with a ready-to-use default configuration.

API Setup

curl -X POST http://localhost:8084/v1/admin/integration-catalog/ga4_collect/install \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Google Analytics 4 (Collect)",
    "variant": "default",
    "config": {
      "measurement_id": "G-XXXXXXXXXX",
      "api_secret": "your_api_secret",
      "client_id_field": "client_id"
    },
    "delivery_mode": "server_side"
  }'

Delivery

Events are delivered server-side from your Datafly Signal infrastructure directly to the Google Analytics 4 API. No client-side scripts are loaded for this integration.

Visit Google Analytics 4 (Collect) documentation for full API documentation and credential setup instructions.