Sub topic 2
Find and Understand the Measurement ID
Assume you understand users, sessions, and events, and that you can access a Google Analytics account. You also need access to the website or its platform settings. This chapter focuses on finding the identifier that connects a website to a GA4 web data stream.
What the Measurement ID identifies
A Measurement ID identifies a web data stream in Google Analytics 4. It usually starts with G-, followed by letters and numbers, such as:
G-ABC123XYZ9The ID tells the Google tag where to send data. It does not identify a particular page, user, or event.
A GA4 setup has several related identifiers:
| Item | What it identifies | Typical form |
|---|---|---|
| GA4 property | The overall Analytics container for a business or app | A numeric property ID |
| Web data stream | A website connected to the property | A stream name and numeric stream ID |
| Measurement ID | The web stream's collection endpoint for tags | `G-ABC123XYZ9` |
The Measurement ID belongs to the web data stream, not directly to the property. A property can contain several streams, such as separate Android, iOS, and web streams. Each web stream has its own Measurement ID.
Find the Measurement ID in GA4
Google occasionally changes menu labels. The following path describes the current structure and the labels you should look for:
- Sign in to Google Analytics.
- Select the correct account and GA4 property.
- Open Admin.
- Under the property column, open Data streams.
- Select the web stream for the website you want to measure.
- Copy the Measurement ID shown in the web stream details.
Check the website address and stream name before copying the value. A property may contain multiple web streams for different sites or environments.
The Stream ID and Measurement ID are different values. The Stream ID is usually a numeric value shown in the stream details. The Measurement ID starts with G- and is the value used in the Google tag configuration.
Use the ID in a Google tag
When you install the Google tag manually, replace the placeholder with the Measurement ID from the selected web stream:
gtag('config', 'G-ABC123XYZ9');The same ID is entered in many website platform integrations. In Google Tag Manager, it is entered in the Google tag configuration. The installation method changes where you enter the value, but the value must still belong to the intended web stream.
A single page should normally send data to the web stream that represents that site. If you intentionally send data to more than one stream, document that design before installing tags. Multiple destinations can make reporting and troubleshooting harder.
Match the ID to the right environment
Many teams have separate development, staging, and production websites. Decide whether those environments should send data to the same stream.
- Use the production stream for the public production site.
- Consider a separate stream or property for testing traffic.
- Do not paste a staging stream's ID into production by mistake.
- Record the stream name, website address, and Measurement ID together.
A Measurement ID is not a secret. It can appear in a page's JavaScript and can be visible to visitors. However, it is still important to use the correct ID because data sent to the wrong stream cannot be sorted out reliably after collection.
A quick identification check
Before installing the tag, confirm all three facts:
- The selected GA4 property is the one whose reports you will use.
- The selected web data stream has the correct website address.
- The copied identifier starts with
G-and matches the Measurement ID displayed in that stream.
If any fact is uncertain, stop and inspect the stream details again. Installation verification is much easier when the destination is known first.
Exercise
A web stream shows property ID 123456789, Stream ID 9876543210, and Measurement ID G-7H8J9K0L1M. Which value belongs in gtag('config', '...'), and why?
Show answer
Use G-7H8J9K0L1M. It is the Measurement ID for the web data stream. The other two values identify the property or stream but are not the Google tag's web collection ID.