Sub topic 1
How GA4 Models Data: Events, Parameters, and User Properties
Prerequisites
Assume you know the basic GA4 interface, have access to a GA4 property and web data stream, and understand JavaScript function calls and objects. This chapter focuses on the data model, not on configuring tags or reports.
The event-based model
Google Analytics 4 (GA4) records user interactions as events. An event is a named occurrence, such as a page view, product selection, login, or purchase. Unlike older session-centered models, GA4 uses events as the primary unit of measurement.
Each event has:
- An event name, such as
loginorpurchase. - Event parameters that describe the occurrence.
- Context added by GA4, such as the timestamp, device, location estimate, and traffic source.
The event name identifies what happened. Parameters explain the details of that occurrence.
gtag('event', 'login', {
method: 'Google'
});This call creates a login event. Its method parameter records how the user logged in. The event name is reusable across users, while the parameter value can differ for each event.
Events, parameters, and user properties
An event parameter is a key-value pair attached to one event. For example, a purchase event might contain transaction_id, value, currency, and items. Parameters describe the action at the time it happens.
A user property describes an attribute of the user rather than one specific action. Examples include a membership tier, preferred language, or account type. The property can apply to later events from that user until its value changes.
gtag('set', 'user_properties', {
membership_tier: 'pro'
});
gtag('event', 'tutorial_complete', {
tutorial_id: 'ga4-events-101',
lesson_count: 6
});Here, tutorial_id and lesson_count describe one tutorial completion. membership_tier describes the user associated with that event.
| Data element | Scope | Example | Main question answered |
|---|---|---|---|
| Event | One interaction | `tutorial_complete` | What happened? |
| Event parameter | One interaction | `lesson_count: 6` | What details describe it? |
| User property | User over time | `membership_tier: 'pro'` | Who performed it? |
A parameter and a user property can contain similar information, but they answer different questions. If a plan type can change between purchases, record the plan on each purchase event. If it represents the user's current account status, use a user property as well.
A practical modeling rule
Model the action as the event name and the changing details as parameters. Use user properties for relatively stable characteristics that describe the user across multiple events.
Avoid putting important details only inside an event name. For example, prefer video_play with video_title and video_length parameters over separate names such as video_play_product_demo and video_play_customer_story. A consistent event name makes comparisons and reporting easier.
Exercise
Exercise
You need to record that a user downloaded a PDF named "setup-guide" while the user belongs to the "business" plan. Which value is the event name, which is an event parameter, and which is a user property?
Show answer
Use file_download as the event name, file_name: 'setup-guide' as an event parameter, and plan_type: 'business' as a user property if the plan describes the user beyond this download.