Sub topic 1
How GA4 Records Events and Parameters
Google Analytics 4 (GA4) uses an event-based data model. An event is a recorded interaction, such as a page view, form submission, product selection, or purchase. Instead of grouping every interaction into fixed hit types, GA4 represents most user activity as events.
An event has a name and optional parameters. Parameters are key-value pairs that describe the event. For example, a purchase event might include transaction_id: "T_12345" and value: 59.98.
Prerequisites
This chapter assumes that you have a GA4 property with a web data stream installed. You should have Editor access to the property and basic familiarity with Reports and Admin. You should also understand what a website form submission or checkout represents. Access to the site code or Google Tag Manager is useful for testing event implementation.
Events and parameters
The event name identifies what happened. Parameters provide context about how, where, or with what value it happened.
| Data element | Example | Purpose |
|---|---|---|
| Event name | `generate_lead` | Identifies the interaction |
| Parameter name | `currency` | Identifies a detail about the interaction |
| Parameter value | `USD` | Supplies the detail's value |
GA4 receives the event name and its parameters together. A lead event might include a form type, while a purchase event might include the order number and products.
gtag('event', 'generate_lead', {
lead_type: 'contact_form',
currency: 'USD',
value: 25.00
});In this example, generate_lead is the event name. lead_type, currency, and value are parameters. The event can be used for reporting even if lead_type is not registered as a custom dimension, but registering a parameter makes it available for many standard reports and explorations.
GA4 also collects some events automatically. Enhanced measurement can collect interactions such as scrolls, outbound clicks, and site searches when those options are enabled in the web data stream. You should still send business outcomes explicitly when their meaning depends on your website or organization.
How GA4 processes an event
The browser or server sends an event to the GA4 property associated with the measurement ID. GA4 then processes the event, applies attribution and user information, and makes selected fields available in reports.
The same event name can be sent many times. Each occurrence is a separate event instance. For example, every successful lead form submission can send generate_lead. GA4 does not know whether a submission is valuable to the business unless you define its meaning and, when appropriate, mark the event as a key event.
Event names and parameter names are case-sensitive. generate_lead, Generate_Lead, and generateLead are different names. Choose a naming convention and use it consistently across all implementations.
Common modeling errors
Avoid putting changing business details into event names. Use one stable event name such as purchase, and put product or order details in parameters. Otherwise, reports become fragmented across names such as purchase_shoes and purchase_jacket.
Also avoid sending personal data in event names or parameters. Email addresses, names, phone numbers, and other personally identifiable information should not be sent to GA4.
Exercise
A website sends form_opened when a visitor views a form and generate_lead after the server confirms a successful submission. Which event better represents a lead outcome, and why?
Show answer
generate_lead represents the outcome because it is sent only after the successful submission. form_opened measures intent, not a completed lead.