Google Analytics · Schema

MeasurementPayload

AnalyticsDataGoogleMetricsReportingWeb AnalyticsMachine LearningAttribution

Properties

Name Type Description
client_id string Uniquely identifies a user instance of a web client. Required for web streams.
app_instance_id string Uniquely identifies a user instance of an app. Required for app streams.
user_id string A unique identifier for a user. Enables cross-platform analysis. Must contain only UTF-8 characters.
timestamp_micros integer Unix timestamp in microseconds for the request. Used to backdate events up to 72 hours.
user_properties object User-scoped properties for the measurement.
user_data object User-provided data for enhanced measurement.
consent object
non_personalized_ads boolean Deprecated. Use consent.ad_personalization instead.
user_location object
ip_override string IP address used to derive geographic information.
device object
validation_behavior string Controls validation strictness. RELAXED only rejects malformed requests. ENFORCE_RECOMMENDATIONS also rejects invalid types and exceeded limits.
events array Array of event objects. Maximum 25 events per request.
View JSON Schema on GitHub

JSON Schema

google-analytics-measurementpayload-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/MeasurementPayload",
  "title": "MeasurementPayload",
  "type": "object",
  "required": [
    "events"
  ],
  "properties": {
    "client_id": {
      "type": "string",
      "description": "Uniquely identifies a user instance of a web client. Required for web streams.",
      "example": "123456789.1234567890"
    },
    "app_instance_id": {
      "type": "string",
      "description": "Uniquely identifies a user instance of an app. Required for app streams.",
      "example": "123456"
    },
    "user_id": {
      "type": "string",
      "description": "A unique identifier for a user. Enables cross-platform analysis. Must contain only UTF-8 characters.",
      "example": "123456"
    },
    "timestamp_micros": {
      "type": "integer",
      "format": "int64",
      "description": "Unix timestamp in microseconds for the request. Used to backdate events up to 72 hours.",
      "example": 1713355200000000
    },
    "user_properties": {
      "type": "object",
      "description": "User-scoped properties for the measurement.",
      "additionalProperties": {
        "$ref": "#/components/schemas/UserPropertyValue"
      }
    },
    "user_data": {
      "type": "object",
      "description": "User-provided data for enhanced measurement."
    },
    "consent": {
      "$ref": "#/components/schemas/Consent"
    },
    "non_personalized_ads": {
      "type": "boolean",
      "description": "Deprecated. Use consent.ad_personalization instead.",
      "deprecated": true,
      "example": true
    },
    "user_location": {
      "$ref": "#/components/schemas/UserLocation"
    },
    "ip_override": {
      "type": "string",
      "description": "IP address used to derive geographic information.",
      "example": "123456"
    },
    "device": {
      "$ref": "#/components/schemas/Device"
    },
    "validation_behavior": {
      "type": "string",
      "description": "Controls validation strictness. RELAXED only rejects malformed requests. ENFORCE_RECOMMENDATIONS also rejects invalid types and exceeded limits.",
      "enum": [
        "RELAXED",
        "ENFORCE_RECOMMENDATIONS"
      ],
      "default": "RELAXED",
      "example": "RELAXED"
    },
    "events": {
      "type": "array",
      "description": "Array of event objects. Maximum 25 events per request.",
      "maxItems": 25,
      "items": {
        "$ref": "#/components/schemas/Event"
      }
    }
  }
}