Sub topic 2
The four kinds of events: automatic, enhanced measurement, recommended, custom
This chapter assumes you know the GA4 interface, can read a JavaScript object, and understand from the previous chapters that every GA4 hit is an event with parameters. Here you will learn how GA4 sorts events into four categories. You will also learn what each category means for the work you must do.
Why the category matters
The category tells you who writes the code, who chooses the name, and who defines the parameters.
- For automatic and enhanced measurement events, Google does all three. You only decide whether to leave the feature on.
- For recommended events, Google chooses the name and parameters, and you write the code that sends them.
- For custom events, you choose everything.
Picking the wrong category has concrete costs. If you send your own scroll event next to an enhanced measurement one, you get duplicate data. If you invent buy_complete instead of using purchase, the built-in monetization reports will not see your sales.
Automatically collected events
GA4 collects these events as soon as the GA4 tag or SDK is installed. You cannot turn them off individually, and you write no event code for them. On the web, the main ones are:
first_visit: the first time a user visits the site.session_start: the start of a session.user_engagement: sent periodically while the page is in the foreground. GA4 uses it to calculate engagement time.page_view: sent when the GA4 tag loads. It is also sent when the browser history changes, if the page-view setting under enhanced measurement is on.
Mobile apps have their own automatic events, such as app_remove and os_update. The exact list depends on the platform.
Use these events as they are in reports and audiences. Do not recreate them. Some of these names are reserved, so you cannot send them yourself (the next chapters cover reserved names).
Enhanced measurement events
Enhanced measurement is a group of events that GA4 detects on web pages by watching browser behavior. You manage them in one place: Admin > Data streams > your web stream > Enhanced measurement. Each event has a toggle, so you decide which ones to collect.
| Event | Toggle name | What triggers it |
|---|---|---|
| `page_view` | Page views | Page load or a browser history change |
| `scroll` | Scrolls | The first time a user reaches about 90% of page depth |
| `click` | Outbound clicks | A click on a link that leads to another domain |
| `view_search_results` | Site search | A page URL containing a search query parameter |
| `video_start`, `video_progress`, `video_complete` | Video engagement | Playback of an embedded YouTube video with the JS API enabled |
| `file_download` | File downloads | A click on a link to a common file type, such as PDF, DOCX or ZIP |
| `form_start`, `form_submit` | Form interactions | A user first interacts with a form, then submits it |
These events are convenient, but they have limits you should know about:
- They detect behavior generically. A
form_submitfires based on the browser's form events, so a form submitted by JavaScript without a standard submit may be missed. Aform_submitmay also fire when a submission fails validation. - The
scrollevent only fires once per page, at 90%. It cannot tell you that a user reached 25% or 50%. - Single-page applications that update content without changing the URL can confuse them.
- If they do not match what you need, turn the toggle off and send a custom event. Do not leave the toggle on and send your own event with the same name, because you will count every action twice.
Enhanced measurement events also carry their own parameters, such as percent_scrolled on scroll. You can use these parameters in reports once you register them (a later chapter covers this).
Recommended events
Recommended events are events that Google has named and described, but does not send for you. You choose when to send them and you supply the values. Google publishes a reference list, grouped by business type: all properties, online sales, games, and so on.
Examples include login, sign_up, search, share, generate_lead, add_to_cart, begin_checkout and purchase. Each event has a defined set of parameters. Some are marked required and some optional. The purchase event, for instance, uses transaction_id, value, currency and an items array.
Using the recommended name has three benefits:
- GA4 reports and features recognize the event. For example, the monetization reports are built from the ecommerce events.
- Google's documentation, integrations and other analysts' expectations all match your data.
- You skip the work of designing a new event.
The example below sends the recommended login event with its recommended method parameter.
gtag('event', 'login', {
method: 'Google'
});The name login and the parameter name method both come from Google's list. Only the value, 'Google', comes from you.
Here is a larger example. The purchase event sends a transaction ID, value, currency and an items array.
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
}
]
});Two details matter here. First, value is the total for the whole purchase, which is 2 x 29.99 = 59.98. Second, transaction_id should be unique per order, because GA4 uses it to avoid counting the same purchase twice.
Custom events
A custom event is any event whose name is not on Google's lists. You use one when you need to measure an interaction that no automatic, enhanced measurement or recommended event describes.
You are free to pick the name and the parameters, but GA4 does not know what they mean. Custom events are not part of the built-in reports. You see them in the Events report, and you register their parameters before you can use those parameters as dimensions or metrics.
gtag('event', 'newsletter_signup_click', {
placement: 'footer',
plan_type: 'free'
});No recommended event describes a click on a newsletter button, so this example uses a custom name. It uses snakecase (lowercase words joined by underscores), which matches Google's own events. It also uses two custom parameters, placement and `plantype`, to describe the context.
A good custom event name describes the action, not the page or the tool. newsletter_signup_click is reusable. A name such as button3_test tells nobody anything.
Custom events carry costs:
- Each distinct name counts against the property's limit on event names. A standard property allows 500 distinct names, so names with dates or IDs inside them can use up that quota.
- Parameters are not available in reports until you register them as custom dimensions or metrics, and those also have limits.
- Someone has to document the event, or its meaning is lost when the person who made it leaves.
Comparing the four categories
| Category | Who sends it | Who names it | Needs code | Where you control it |
|---|---|---|---|---|
| Automatic | GA4 | No | Cannot disable individually | |
| Enhanced measurement | GA4 | No | Toggles in the web data stream | |
| Recommended | Your code | Yes | Your implementation | |
| Custom | Your code | You | Yes | Your implementation and tracking plan |
Choosing a category in practice
Work down this list for each measurement need and stop at the first match:
- Does an automatic event already measure it? Use it.
- Does an enhanced measurement event measure it well enough? Turn it on and use it.
- Does a recommended event describe it? Send that event with its recommended parameters.
- Otherwise, create a custom event and document it.
If a recommended event is close but not an exact match, prefer it and add custom parameters for the extra detail. For example, you can send generate_lead with a custom form_name parameter. This is usually better than inventing a lead_form_submitted event.
Exercise
A site has enhanced measurement turned on. A developer adds gtag('event', 'file_download', {...}) to every PDF link. What problem will this cause, and what are two ways to fix it?
Show answer
GA4 already sends file_download for PDF clicks, so each click is counted twice. Fix it by removing the manual code and relying on enhanced measurement, or by turning off the File downloads toggle and keeping the manual code, so only one source sends the event.
Exercise
You need to measure completed checkouts in an online shop, and separately a click on a "Compare plans" button. Which category fits each?
Show answer
Completed checkouts fit the recommended purchase event, with transaction_id, value, currency and items. No recommended event describes the "Compare plans" click, so it needs a custom event with a snakecase name such as `compareplans_click`.