Sub topic 12
Key events: marking the events that matter
This chapter assumes you know what a GA4 event and event parameter are, how data streams feed a property, and how sessions and users are derived from events. You should be able to read basic gtag JavaScript. You do not need to have configured a key event before.
What a key event is
A key event is an event that you flag as important to your business. Examples are a purchase, a lead form submission, or a newsletter signup. Google Analytics 4 (GA4) used to call these "conversions". In March 2024 the interface renamed them to key events. The name "conversion" now belongs to Google Ads, which has its own conversion actions.
Marking an event as a key event does not change how the event is collected. The event is sent and stored in the same way as before. The flag adds a label in your property. Reports then use that label to count the event separately, and other products can read it.
This is the main idea of the chapter. A key event is not a new kind of data. It is a property of the event name, set in the GA4 interface or through the Admin API.
Why the flag matters
Once an event is flagged, GA4 does the following:
- It adds the event to key event metrics. In reports you can see Key events (a count of flagged events) alongside the event's own count.
- It computes rates. Session key event rate is the share of sessions with at least one key event. User key event rate is the share of active users who triggered at least one.
- It lets you break key events down by acquisition dimensions, such as source and medium, so you can see which channels lead to the outcome.
- It makes the event available to link products. Linked Google Ads accounts can import key events as conversions. Key events also appear in some Explore and attribution reports.
The flag does not delete or hide anything. Unflagged events remain fully available in the Events report and in Explorations.
How to mark an event
There are two common paths.
- Go to Admin, then Data display, then Key events. Choose New key event and type the exact event name.
- Go to Reports, then Engagement, then Events. Find the event in the table and switch on the star toggle in the Mark as key event column.
The first path works even if GA4 has not seen the event yet. This lets you flag an event before you deploy the tracking code.
The event name must match exactly. GA4 event names are case-sensitive, so Generate_Lead and generate_lead are two different events. Flagging one does nothing for the other.
Example: a lead form
Send a recommended event when the form is submitted successfully:
// Send after the form submit succeeds, not when the button is clicked
gtag('event', 'generate_lead', {
currency: 'USD',
value: 50,
form_name: 'contact_sales'
});Then flag generate_lead in Admin. The form_name parameter is a custom parameter. It is collected now. It appears in reports only after you register it as a custom dimension, as the previous chapter on custom definitions described.
Which events to flag
Pick a short list. A property with 30 key events produces a key event count that nobody can interpret.
A useful test has three parts:
- The event signals an outcome the business cares about, not a step along the way.
- The event fires once per meaningful action, and only when that action truly succeeds.
- You would be willing to optimize a marketing campaign toward it.
Compare these two choices for a purchase flow:
| Event | Good key event? | Reason |
|---|---|---|
| `purchase` | Yes | It is the final outcome and carries revenue. |
| `add_to_cart` | Usually no | It is a funnel step. Use it in a funnel exploration instead. |
| `page_view` | No | It fires on every page and says nothing about success. |
| `generate_lead` | Yes, for lead sites | It is the outcome for that business model. |
Funnel steps are better analyzed with funnel explorations, which do not need any flag.
Default key events
New properties begin with a small number of events already flagged. In most properties purchase is flagged by default, and some setups also flag events such as first_open. Check the Key events list in Admin when you take over a property. Do not assume it is empty or that it matches your goals.
Counting method: once per event or once per session
Each key event has a counting method. This setting decides how many times GA4 counts the event.
- Once per event counts every occurrence. If a user completes two
generate_leadevents in one session, GA4 records two key events. - Once per session counts the event at most one time in each session.
The default depends on the event. purchase counts once per event, because two orders are two sales. Other events often default to once per session, because several signups from one visit usually come from the same intent.
Change the setting in Admin, Key events, by opening the event's row menu. The change applies from that point on. It does not recalculate older data.
The counting method affects the Key events metric. It does not change the raw event count. The Event count metric always counts every event that was sent. So a mismatch between "Event count" and "Key events" for the same event is often explained by this setting.
Timing and history
Flagging is not retroactive in the way many people expect. When you flag an event, GA4 begins counting it as a key event from that moment. Data collected earlier is not relabeled in standard reports. If you flag generate_lead on 15 March, a report for 1 to 31 March shows key events only from 15 March onward.
Unflagging works the same way. Past data keeps its earlier label, and new data stops being counted.
To recover history, use the raw event count for the event name, which was recorded all along. In BigQuery, the export has one row per event, so the history is there regardless of the flag. See the sections on the export below.
The following diagram shows where the flag sits in the flow.
Limits and quotas
GA4 limits how many key events a property can have. A standard property allows up to 30 key events, and GA4 360 properties allow more. Limits can change, so confirm the current number in the Google documentation. The practical lesson is to keep the list focused well below the cap.
Deleting a key event flag frees a slot. The underlying event is not deleted.
Key events in the BigQuery export
The BigQuery export does not store a key event flag on each row. Each row is one event, with its name, parameters, and the user and session identifiers. To find key events in SQL, you filter by event name yourself.
-- Count key event occurrences and the users who triggered them
SELECT
event_date,
event_name,
COUNT(*) AS key_event_count,
COUNT(DISTINCT user_pseudo_id) AS users
FROM `my-project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20240101' AND '20240131'
AND event_name IN ('purchase', 'generate_lead')
GROUP BY event_date, event_name
ORDER BY event_date, event_name;This query counts every occurrence, like the once per event method. If a report in the interface uses once per session for generate_lead, the interface number will be lower. To reproduce the per-session count, count distinct sessions that contain the event, using user_pseudo_id and the ga_session_id parameter as in the earlier chapter on the export.
Keep this in mind when you reconcile interface and SQL numbers. The two should agree once you apply the same counting rule and the same date range and time zone.
Common problems
- The event fires too often. A thank-you page that reloads sends
generate_leadagain each time. Send the event from the submit success handler, or guard against repeats. - The event fires too early. Sending it on button click counts failed submissions. Send it after the server confirms.
- Name mismatch. A typo or different capitalization produces an event that is never flagged. Compare names in the Events report against your Key events list.
- Expecting history. As described above, flagging does not relabel earlier data.
- Flagging too many events. The Key events metric becomes a sum of unrelated things.
- Confusing GA4 key events with Google Ads conversions. Importing a key event into Google Ads creates a separate conversion action there. Changes in Ads settings do not edit the GA4 flag.
Putting it together
A key event is an ordinary event with a label attached to its name. The label controls reporting: the Key events metric, key event rates, channel breakdowns, and imports to linked products. The counting method controls how many occurrences are counted. The label starts working from the moment you set it and does not rewrite the past. In BigQuery you recreate the same view by filtering on event names.
Exercises
Exercise
Your team flags generate_lead on 10 June. A report for 1 to 30 June shows 40 key events, but the Events report shows 70 generate_lead events for the same range. Give two possible explanations.
Show answer
First, flagging is not retroactive, so generate_lead events from 1 to 9 June were not counted as key events. Second, the counting method may be once per session, so several events in one session count as one key event while Event count counts all of them. Both can apply at the same time.
Exercise
Write a BigQuery condition and approach to count generate_lead once per session for January 2024, using the export fields from earlier chapters.
Show answer
Filter with event_name = 'generate_lead' and _TABLE_SUFFIX BETWEEN '20240101' AND '20240131'. Then count distinct combinations of user_pseudo_id and the ga_session_id event parameter, for example with COUNT(DISTINCT CONCAT(userpseudoid, '.', CAST(gasessionid AS STRING))), where gasessionid is read from eventparams with a subquery over UNNEST(eventparams).
Exercise
A colleague wants to flag page_view, add_to_cart, begin_checkout, and purchase so that "we can see the whole funnel". What would you recommend instead?
Show answer
Flag only purchase, which is the outcome. Use a funnel exploration to analyze the steps from page_view to add_to_cart, begin_checkout, and purchase. This keeps the Key events metric meaningful and does not use up key event slots.