Where to find your GA4 measurement ID, and what it is not
The G- measurement ID identifies a GA4 web stream. Where to find it, how it differs from the property ID and the Measurement Protocol secret, and who sees it.
GA4 has several identifiers that look similar, and pasting the wrong one into your site is a common reason a tag sends nothing. The one the tag needs is the measurement ID, and it always starts with G-.
Finding it
- Open Google Analytics and choose the property.
- Admin, then Data collection and modification, then Data streams.
- Choose the web stream for your site.
- Copy the Measurement ID from the stream details.
The identifiers, side by side
| Identifier | Looks like | Used for | Private? |
|---|---|---|---|
| Measurement ID | G-ABC123XYZ | The tag on your site | No, it is public |
| Property ID | A number, like 412345678 | Admin, APIs, support | No, but not needed in the tag |
| Stream ID | A longer number | The Admin API | No |
| Measurement Protocol API secret | A random string | Server-side events | Yes, keep it secret |
Old IDs
An ID starting UA- belonged to Universal Analytics, which Google shut down. If your site still has one, it is sending nothing useful. Replace it with a G- ID from a GA4 property.
One property, several streams
A property can hold a web stream and app streams. Each web stream has its own measurement ID. If you see two G- IDs for one site, check whether someone created a second stream, or a second property, by accident; data split across them is hard to combine later.
Keep it in one place
Put the ID in one config value or environment variable and read it wherever the tag loads. A site with the ID typed into three templates eventually has two different IDs. On this site it lives in one tracking config file. For framework specifics, see adding GA4 to Next.js.
GA4 + Search Console Setup creates the web stream, reads the measurement ID itself and writes it into your code, so there is no copying between the Google console and your editor.
Questions
Where do I find the GA4 measurement ID?
In Admin, open Data streams, choose your web stream, and the measurement ID starting with G- is shown in the stream details.
Is the measurement ID secret?
No. It is in the source of every page that loads the tag. Anyone can read it. The Measurement Protocol API secret is different and should be kept private.
What is the difference between the property ID and the measurement ID?
The property ID is a number that identifies the whole property, used in the Admin and APIs. The measurement ID starts with G- and identifies one web data stream; it goes in the tag.