Measurement ID

Measurement ID is a unique identifier that routes events to the correct analytics dataset (property/stream). It’s the address label on your hits: the site’s tag reads it from config, attaches it to every event, and the backend delivers the data to the right bucket.

How it works (in practice)

Why it matters

  • Data integrity: Wrong ID = data lands in the wrong stream.
  • Environment isolation: Keep separate IDs for prod/stage to avoid polluted dashboards.
  • Migration safety: When replacing legacy Tracking ID (see tracking-id-measurement-id), map Measurement IDs one-to-one with new streams.

Format and scope

  • Format: fixed prefix + alphanumeric suffix (example shape like G-XXXX...).
  • Scope: one ID per stream/environment (web, iOS, Android, staging, etc.).

Tiny formula

event → tag → Measurement_ID → stream(dataset)

Sanity table

CheckGoodBad
Environment mappingprod → ID_P, stage → ID_Sprod & stage → ID_P
Tag sourceManaged in Tag ManagerHardcoded copies across repos
PayloadIncludes Event ParametersMissing params, weak context

Common pitfalls: copying third-party widgets that override your Measurement ID; cloning repos without swapping environment IDs; mixed locales/brands pointed to one stream.