Sub topic 1
How GA4 models data: events, parameters, and user properties
Google Analytics 4 (GA4) stores every interaction as an event. Pageviews, clicks, purchases, and logins all use the same structure. This chapter explains that structure and the three kinds of data attached to it: events, event parameters, and user properties. Later chapters build on it when they cover recommended and custom events.
Prerequisites
This chapter assumes you have:
- Basic familiarity with the GA4 interface, such as Reports and Admin.
- A GA4 property with a web data stream, or access to create one.
- Basic understanding of JavaScript objects and function calls.
- Basic familiarity with Google Tag Manager (GTM) containers, tags, and triggers. This matters mostly for later chapters.
From sessions and hits to events
Universal Analytics, the previous version of Google Analytics, used several hit types: pageview, event, transaction, and social. Each had its own fields. An event there had a fixed shape of category, action, and label.
GA4 replaces all of that with one model. Every interaction is an event. A pageview is an event named page_view. A session start is an event named session_start. A purchase is an event named purchase. Because every interaction has the same shape, you can use the same reports, filters, and exports on any of them.
Sessions still exist in GA4, but they are derived. GA4 groups events into sessions after collection. You do not send a session. You send events, and GA4 builds sessions from them.
The three building blocks
Each piece of data you send belongs to one of three layers.
| Layer | What it describes | Example | Scope |
|---|---|---|---|
| Event | What happened | `purchase`, `login`, `page_view` | One occurrence |
| Event parameter | Context about that occurrence | `value`, `currency`, `method` | The single event |
| User property | An attribute of the person | `plan_type`, `customer_tier` | All later events from that user |
An event name answers "what happened". Parameters answer "what were the details". User properties answer "who did it, in a way that stays true across events".
Anatomy of an event
An event has a name and zero or more parameters. In gtag.js, the event command takes the name first and a parameter object second.
gtag('event', 'login', {
method: 'Google'
});Here login is the event name. method is a parameter with the value 'Google'. The event says a login happened. The parameter says how.
A parameter is a key and a value. The value is either a string or a number. Whether it is treated as text or as a measurable quantity affects how you report on it, which a later chapter covers.
Event parameters in more detail
Parameters give an event its meaning. Two purchase events are only useful to compare if each carries a value and a currency.
Here is a larger example with an array of items.
gtag('event', 'purchase', {
transaction_id: 'T_12345',
value: 59.98,
currency: 'USD',
items: [
{
item_id: 'SKU_123',
item_name: 'Trail Shoes',
price: 29.99,
quantity: 2
}
]
});This event has three flat parameters (transaction_id, value, currency) and one structured parameter, items. The items array holds one object per product. Each object has its own item-level fields. GA4 reads these for ecommerce reports.
A few points about parameters:
- Parameters belong to one event. A
valueonpurchasehas no link to avalueon another event. - Some parameters are predefined. GA4 knows
value,currency, andmethodand uses them in standard reports. - You can invent your own parameters. GA4 collects them, but they do not show in standard reports until you register them as custom dimensions or metrics.
That last point is a common source of confusion. Collection and reporting are separate steps. A parameter can arrive in GA4 and still be absent from the Explore or Reports interface.
User properties
A user property describes the user instead of one action. Examples are a subscription plan, a preferred language, or a customer tier. Once set, GA4 attaches it to later events from that user until it changes.
gtag('set', 'user_properties', {
customer_tier: 'gold'
});Use a user property when the value describes the person and applies to many events. Use an event parameter when the value describes one action. A plan_type of free that you want to filter every event by suits a user property. A placement of footer that only matters for one click suits an event parameter.
Keep user properties for non-identifying data. Google's policies prohibit sending personally identifiable information, such as email addresses, to GA4.
Four kinds of events
GA4 groups events by who defines them. The next chapters cover each group in detail, so only the overview follows here.
| Category | Who defines it | Example |
|---|---|---|
| Automatically collected | GA4, always on | `session_start`, `first_visit` |
| Enhanced measurement | GA4, toggled in the data stream settings | `scroll`, `file_download` |
| Recommended | Google defines the name and parameters, you implement it | `login`, `purchase`, `sign_up` |
| Custom | You define the name and parameters | `newsletter_signup_click` |
A custom event is the fallback. You use it only when no automatic, enhanced, or recommended event describes the interaction.
gtag('event', 'newsletter_signup_click', {
placement: 'footer',
plan_type: 'free'
});The name uses snake_case, which means lowercase words joined by underscores. This follows GA4 naming conventions, which a later chapter covers in full.
What happens after you send an event
The path from page to report has several stages.
- Your code calls
gtag('event', ...), or a GTM tag does it for you. - The browser sends a request to Google's collection endpoint with the event name, its parameters, and identifiers for the user and session.
- GA4 processes the request. It adds session information, device and location details, and any user properties.
- The event appears in DebugView within seconds if debug mode is on. It appears in standard reports after a longer processing delay.
- Parameters become usable in reports only after you register them as custom definitions.
Knowing these stages helps with troubleshooting. If an event shows in DebugView but not in a report, the problem is usually processing delay or missing registration. It is rarely the implementation itself.
Common mistakes with the model
- Treating GA4 events like Universal Analytics events. GA4 has no category, action, and label fields. Put those ideas in parameters instead.
- Packing meaning into the event name. Names such as
click_footer_signup_freemake the name list grow without limit. Use one event name with parameters such asplacementandplan_type. - Using a user property for per-action data. The value would carry over to later events where it does not apply.
- Expecting a new parameter to appear in reports immediately. It needs registration first.
- Sending a parameter once with a string and later with a number. Mixed types make the data hard to use.
Summary of the model
GA4 collects events. An event has a name and parameters. Parameters describe one occurrence. User properties describe the person across many occurrences. Google defines some events and their parameters. You define the rest. Reports see only the parameters you register.
Exercise
A user sets their subscription to "premium" once, and you want to filter every later event by it. Separately, you want to record which page section a "Download guide" button was clicked in. For each value, say whether you would use a user property or an event parameter, and why.
Show answer
The subscription is a user property, because it describes the person and stays true across many events. The page section is an event parameter, because it describes only that one click. Sending the section as a user property would carry it onto later events where it does not apply.
Exercise
Your purchase event shows in DebugView with a custom parameter coupon_tier, but you cannot find coupon_tier in a report dimension list. What is the most likely cause?
Show answer
The parameter is collected but not registered as a custom dimension. GA4 only offers custom parameters in reports after you register them as event-scoped custom dimensions or metrics.