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-measurement-payload-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-analytics/json-schema/google-analytics-measurement-payload-schema.json",
  "title": "MeasurementPayload",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-analytics-events-api-openapi.yml#/components/schemas/MeasurementPayload",
  "type": "object",
  "required": [
    "events"
  ],
  "properties": {
    "client_id": {
      "type": "string",
      "description": "Uniquely identifies a user instance of a web client. Required for web streams."
    },
    "app_instance_id": {
      "type": "string",
      "description": "Uniquely identifies a user instance of an app. Required for app streams."
    },
    "user_id": {
      "type": "string",
      "description": "A unique identifier for a user. Enables cross-platform analysis. Must contain only UTF-8 characters."
    },
    "timestamp_micros": {
      "type": "integer",
      "format": "int64",
      "description": "Unix timestamp in microseconds for the request. Used to backdate events up to 72 hours."
    },
    "user_properties": {
      "type": "object",
      "description": "User-scoped properties for the measurement.",
      "additionalProperties": {
        "$ref": "#/$defs/UserPropertyValue"
      }
    },
    "user_data": {
      "type": "object",
      "description": "User-provided data for enhanced measurement."
    },
    "consent": {
      "$ref": "#/$defs/Consent"
    },
    "non_personalized_ads": {
      "type": "boolean",
      "description": "Deprecated. Use consent.ad_personalization instead.",
      "deprecated": true
    },
    "user_location": {
      "$ref": "#/$defs/UserLocation"
    },
    "ip_override": {
      "type": "string",
      "description": "IP address used to derive geographic information."
    },
    "device": {
      "$ref": "#/$defs/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"
    },
    "events": {
      "type": "array",
      "description": "Array of event objects. Maximum 25 events per request.",
      "maxItems": 25,
      "items": {
        "$ref": "#/$defs/Event"
      }
    }
  },
  "$defs": {
    "Consent": {
      "type": "object",
      "properties": {
        "ad_user_data": {
          "type": "string",
          "description": "Consent for using user data in advertising.",
          "enum": [
            "GRANTED",
            "DENIED"
          ]
        },
        "ad_personalization": {
          "type": "string",
          "description": "Consent for ad personalization.",
          "enum": [
            "GRANTED",
            "DENIED"
          ]
        }
      }
    },
    "Device": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string",
          "description": "Device category (e.g., mobile, tablet, desktop)."
        },
        "language": {
          "type": "string",
          "description": "Device language setting."
        },
        "screen_resolution": {
          "type": "string",
          "description": "Screen resolution (e.g., 1920x1080)."
        },
        "operating_system": {
          "type": "string",
          "description": "Operating system name."
        },
        "operating_system_version": {
          "type": "string",
          "description": "Operating system version."
        },
        "model": {
          "type": "string",
          "description": "Device model."
        },
        "brand": {
          "type": "string",
          "description": "Device brand."
        },
        "browser": {
          "type": "string",
          "description": "Browser name."
        },
        "browser_version": {
          "type": "string",
          "description": "Browser version."
        }
      }
    },
    "Event": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the event. Must not use reserved names (ad_click, app_exception, error, session_start, etc.) or reserved prefixes (_, firebase_, ga_, google_, gtag.)."
        },
        "params": {
          "type": "object",
          "description": "Event parameters as key-value pairs. Common parameters include session_id, engagement_time_msec, and timestamp_micros.",
          "additionalProperties": true,
          "properties": {
            "session_id": {
              "type": "string",
              "description": "Session identifier for accurate session metrics."
            },
            "engagement_time_msec": {
              "type": "integer",
              "description": "User engagement duration in milliseconds."
            },
            "timestamp_micros": {
              "type": "integer",
              "format": "int64",
              "description": "Unix epoch time in microseconds to override event timestamp."
            }
          }
        }
      }
    },
    "UserLocation": {
      "type": "object",
      "properties": {
        "city": {
          "type": "string",
          "description": "City name."
        },
        "region_id": {
          "type": "string",
          "description": "Region identifier."
        },
        "country_id": {
          "type": "string",
          "description": "Country identifier."
        },
        "subcontinent_id": {
          "type": "string",
          "description": "Subcontinent identifier."
        },
        "continent_id": {
          "type": "string",
          "description": "Continent identifier."
        }
      }
    },
    "UserPropertyValue": {
      "type": "object",
      "properties": {
        "value": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            }
          ],
          "description": "The value of the user property."
        }
      }
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/google-analytics-measurement-payload"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.