Sub topic 1
The data you are verifying: events, parameters and streams
Prerequisites
This chapter assumes you can already do the following:
- Open a GA4 property and find the Admin area.
- Name a few common events, such as
page_vieworpurchase. - Edit your site's tag code, or ask someone who can.
- Use a GA4 property with at least one web or app data stream. You need Editor access to change settings.
You do not need to know the Realtime report or DebugView yet. This chapter builds the vocabulary that the later chapters rely on.
Why start with the data model
Realtime and DebugView do not show you "traffic" in a vague sense. They show a small set of objects: events, the parameters attached to them, user properties, and the data stream that sent them. If you can name those objects, you can tell what a screen is showing and what is missing from it.
Most verification problems come from a mismatch at this level. Examples are an event sent with a different name than the one you expected, a parameter that arrives but is not registered for reports, or a hit that went to the wrong stream. Knowing the model lets you tell these cases apart quickly.
Events are the unit of measurement
In GA4, every interaction is an event. A page view, a click, a purchase and a scroll all use the same structure. An event has:
- A name, such as
sign_up. Names are case-sensitive, soSign_Upandsign_upare two different events. - Zero or more parameters, which are key-value pairs that describe the event.
- A timestamp and some identifiers that say which user and device produced it.
Events fall into groups, depending on who defines them.
| Group | Who defines it | Examples |
|---|---|---|
| Automatically collected | GA4 collects them as soon as the tag or SDK is installed | `first_visit`, `session_start`, `user_engagement` |
| Enhanced measurement | GA4 collects them on web streams if the option is on | `scroll`, `click` (outbound), `file_download`, `video_start` |
| Recommended | Google defines the name and parameters, and you implement them | `login`, `sign_up`, `purchase`, `add_to_cart` |
| Custom | You define the name and parameters | `newsletter_modal_open` |
When you verify a setup, the question is usually "did the right event, with the right name and parameters, arrive?" Using the recommended names where they exist is worth the effort. Reports and features built for those names then work without extra setup.
Parameters add detail to an event
A parameter is a key-value pair sent with an event. In the sign_up example used in this tutorial, method is the parameter and email is its value.
gtag('event', 'sign_up', {
'method': 'email'
});Some parameters are sent automatically with every event, such as page_location, page_title and page_referrer on web. Others are specific to an event. Recommended events have documented parameter names, and you can add your own.
Two points matter for verification.
- Sending a parameter is not the same as reporting on it. A parameter appears in the standard reports and Explorations only after you register it as a custom dimension or custom metric in the property. DebugView and Realtime are useful here because they can show that a parameter arrived, even when it is not registered yet.
- Parameters have limits on their names and values. Names and values that are too long can be truncated or dropped. If a value looks cut off in DebugView, check the length of the value you sent.
User properties describe the person or device
A user property is an attribute of the user that stays attached to later events. It is not tied to one action. Typical examples are plan_type or customer_tier. You set the value once, and GA4 sends it with every event after that, until you change it.
gtag('set', 'user_properties', {
'plan_type': 'premium'
});The difference from an event parameter is scope. A parameter describes one event. A user property describes the user across events. When you check an implementation, look at both. A missing user property will not show up as a missing event, so you can miss it if you only watch the event names.
Data streams are where the data enters
A data stream is a source of data feeding a property. A property can have several streams. GA4 has three kinds:
- A web stream, for a website. It is identified by a measurement ID that starts with
G-, such asG-XXXXXXXXXX. - An iOS app stream.
- An Android app stream.
The stream is the first thing to check when events do not appear where you expect them. A tag that carries the measurement ID of a different stream or property sends its data there, and the property you are looking at stays empty. A property can also contain a web stream for a staging site and one for production. In that case, check which stream you are testing.
The same event can come from different places, and you will see this when you read the screens in later chapters. Two sources are worth separating now.
- Client-side collection. The browser or app sends the event, through
gtag.js, Google Tag Manager or a mobile SDK. - Measurement Protocol. Your server sends the event over HTTP. It needs a
client_idfor web streams, and an API secret created for the stream.
Events sent by Measurement Protocol are not tied to a browser session unless you pass the right identifiers. They can look like separate users if you do not. A later chapter covers how to debug these events.
How an event travels
The path from the user's action to the screen you check has several steps. Seeing the path helps you place a problem.
The path shows where a failure can occur:
- The action never creates the event, for example because a trigger is misconfigured.
- The event is created but the tag does not send it, for example because the tag is blocked or the code has an error.
- The tag sends it to the wrong stream or property.
- The event arrives, but a filter or a setting changes how it is shown.
Realtime and DebugView both read data soon after it arrives, which makes them the right tools for stages 2 to 4. Standard reports come after processing and are not the place to check a change you just made.
Identifiers you will meet
Several identifiers appear in the screens and in code. Knowing what each one means avoids confusion.
| Identifier | What it is | Where you see it |
|---|---|---|
| Measurement ID | The ID of a web stream, in the form `G-XXXXXXXXXX` | Tag code, stream details in Admin |
| Property ID | The numeric ID of the property | Admin, and Data API calls |
| `client_id` | A pseudonymous ID for a browser or app instance | Measurement Protocol payloads, cookies |
| `user_id` | Your own ID for a signed-in user, if you set it | Your tag code, reports that use it |
| API secret | A key for sending Measurement Protocol events to a stream | Stream settings in Admin |
Do not mix up the measurement ID and the property ID. The first one goes into tags and Measurement Protocol requests. The second one goes into Data API requests.
A short checklist before you test
Before you open any verification screen, write down four things:
- The exact event name you expect.
- The parameters you expect, with example values.
- Any user properties you expect.
- The stream, and so the measurement ID, that should receive the data.
With this list you can compare what you see against what you intended. Without it, it is easy to accept any event that looks close enough.
Exercise
A developer adds gtag('event', 'Sign_Up', { 'method': 'email' }) to a registration page. Your reports expect an event named sign_up. In a test, the event arrives in GA4. Name the problem, and say which part of the event model explains it.
Show answer
Event names are case-sensitive, so Sign_Up is a different event from sign_up. The event arrives, but under the wrong name, and the reports that expect sign_up will not include it. The fix is to send the exact name sign_up, which is the recommended event name.
Exercise
You send a purchase event with a custom parameter coupon_tier. The parameter is visible when you inspect the event, but you cannot find it as a dimension in a standard report. What is the likely reason, and what do you do?
Show answer
The parameter was received but is not registered as a custom dimension. Register coupon_tier as an event-scoped custom dimension in the property. It is then available for reports from that point on.