Sub topic 1
How GA4 Records Events and Parameters
Prerequisites
This chapter assumes you have:
- A GA4 property with a web data stream and the GA4 tag installed on your site.
- Editor access to the property in Google Analytics.
- Basic familiarity with the Reports and Admin areas of the GA4 interface.
- Basic knowledge of a form submission or checkout on your site.
- Optional: access to Google Tag Manager or your site's code.
How GA4 records events and parameters
GA4 records every interaction as an event. An event has a name, such as page_view, and parameters, which are extra details such as page_location. A parameter is a key-value pair that describes the event. Parameters let you split one event into many useful categories in reports.
Automatic, recommended, and custom events
GA4 handles events in three groups:
| Type | Who sets it up | Examples |
|---|---|---|
| Automatic | GA4 collects it by default | `first_visit`, `session_start` |
| Recommended | You send it with standard names | `generate_lead`, `purchase` |
| Custom | You invent the name | `download_brochure` |
Use a recommended name when one fits. Google's reports and ad integrations recognize those names, so you get more value with less setup.
What a key event is and how it replaced conversions
A key event is any event you mark as important to your business. GA4 renamed conversions to key events in 2024. Marking an event as a key event tells GA4 to count it in key event reports. The event data itself does not change. Only its status in reports does.
Deciding what counts as a lead and a sale
Start with the business outcome. A lead is a visitor who gives you contact details, such as a completed contact form. A sale is a completed order. Write each definition in one sentence before you touch any code. A clear definition prevents you from counting a button click as a lead.
Designing the lead event
Send generate_lead after a form submits successfully, with a value and a currency:
gtag('event', 'generate_lead', {
currency: 'USD',
value: 25.00
});The value is your estimate of what one lead is worth. It does not have to be exact, but it should be consistent.
> Note: Fire the event after the server confirms the submission, not when the button is clicked. Otherwise, failed submissions get counted.
Exercise
Your contact form sends generate_lead when the button is clicked, even if the server returns an error. Why is this a problem, and what should you change?
Show answer
The event counts leads that never reached you. Move the gtag call so it runs only after the server confirms success.