Skip to content

Web and product analytics

How to set up event tracking in GA4

By the editors of Analytics1.comLast reviewed 19 October 20263 min read

The short answer

In GA4 everything is an event. Turn on enhanced measurement for page views, scrolls, outbound clicks, site search, file downloads and form interactions, add Google's recommended events (such as generate_lead or purchase) for the actions that matter, and mark the few that represent business outcomes as key events. Register any custom parameter you want in reports as a custom dimension, and check each event in DebugView before trusting it.

Key takeaways

  • Turn on enhanced measurement, then add recommended events such as generate_lead and purchase for the actions that matter.
  • Mark only business outcomes as key events, and register custom parameters as custom dimensions before you need them.
  • Test every event in DebugView, and raise data retention to 14 months on day one.
On this page 7 sections
  1. The four kinds of event
  2. Step by step
  3. Naming and limits that cause trouble
  4. Key events and Google Ads conversions
  5. How long until you see data
  6. Questions
  7. Sources

The four kinds of event

  • Automatically collected: first_visit, session_start, user_engagement and a few others. You do nothing; you cannot turn them off.
  • Enhanced measurement: page_view, scroll (90% depth), click (outbound), view_search_results, video_start/progress/complete (embedded YouTube), file_download and form_start/form_submit. Toggled per web data stream in Admin.
  • Recommended events: names Google has defined, with expected parameters, such as generate_lead, sign_up, login, add_to_cart, begin_checkout and purchase. Using Google's names unlocks standard reports and makes the data portable to Google Ads.
  • Custom events: anything else you name yourself. Use them only when no recommended event fits.

Step by step

  1. In Admin, open your web data stream and check which enhanced measurement options are on. Form interactions are worth testing before you rely on them: they fire on many forms but misread some multi-step and embedded forms.
  2. List the five to ten actions that show a visitor moving toward revenue: a quote request, a booking, a phone-number click, a demo request, a purchase.
  3. Map each action to a recommended event name where one exists. A contact or quote form is generate_lead; a paid order is purchase with value, currency and transaction_id.
  4. Send the events. With Google Tag Manager, create a GA4 Event tag per action, triggered by a form-submission, click or custom dataLayer event. In code, call gtag('event', 'generate_lead', { value: 120, currency: 'USD' }).
  5. Open DebugView (Admin, then DebugView) with the Tag Assistant preview running, perform each action and confirm the event and its parameters arrive.
  6. Mark the outcome events as key events in Admin, then Events. Leave micro-actions such as scrolls as ordinary events.
  7. Register any custom parameter you want to filter or break down by (form_name, plan, location) as a custom dimension in Admin, then Custom definitions. Reports only show a parameter after it is registered, and registration is not retroactive.

Naming and limits that cause trouble

  • Event names are case-sensitive: Generate_Lead and generate_lead are two different events. Use lowercase with underscores.
  • Event names can be up to 40 characters, and an event can carry up to 25 parameters.
  • A standard property allows 50 event-scoped custom dimensions. Do not register a dimension for every parameter; register the ones you will report on.
  • Never put personal data (email addresses, names, phone numbers) in event names, parameters or page URLs. Google's terms prohibit sending it to GA4.

Key events and Google Ads conversions

In March 2024 Google renamed GA4 "conversions" to key events. A key event is a GA4 measure of an important action. A Google Ads conversion is what bidding optimises toward, and you create it by importing a key event into Google Ads (or with the Google Ads tag). Marking an event as key in GA4 does not, by itself, change your ad bidding.

If calls and form leads are your real outcomes, GA4 sees only the click or the submission, not whether the lead was any good. A lead tracking platform can record the call or form, mark it qualified and send only qualified leads to Google Ads. See how to track form submissions and leads.

How long until you see data

DebugView and the Realtime report show events within seconds. Standard reports can take 24 to 48 hours to process, so do not conclude an event is broken on the day you add it. Explorations use event-level data that is kept for two months by default; raise retention to 14 months in Admin, then Data retention, on day one, because the setting is not retroactive.

Questions

What is the difference between an event and a key event in GA4?
Every interaction GA4 records is an event. A key event is an event you have marked as important to the business, such as a lead or purchase, so it is counted separately in reports and can be imported into Google Ads as a conversion.
Why does my custom parameter not appear in GA4 reports?
Custom parameters only appear in standard reports after you register them as custom dimensions in Admin, then Custom definitions. Registration is not retroactive, so data from before you registered it will not show.
Should I use recommended event names or my own?
Use Google's recommended names (generate_lead, sign_up, purchase and so on) wherever one fits. They populate built-in reports and map cleanly to Google Ads. Create a custom event only for actions with no recommended equivalent.

Sources

Next step

Compare the tools for this job

Related guides