Setting Up Custom Events in GA4 (2024 Updated)

...
Josh Pettovello
Share:

Google Analytics 4 (GA4) changes how we track event conversions, moving away from the categories of goals and ecommerce transactions used in Universal Analytics (UA). Instead, GA4 uses events to track all conversions, simplifying the process. 

Discover how to set up recommended and custom event tracking in Google Analytics 4, starting with a basic understanding of what events are.

What is an Event in GA4?

In Google Analytics 4 (GA4), an event is any user interaction or system occurrence on a website or app. Any time a user action occurs, such as a page view, click, scroll, or purchase, GA4 records it as an event.

Events in GA4 differ significantly from those in Universal Analytics (UA), where events were just one of several trackable data types. In GA4, every interaction is an event.

For example, someone clicks a link on your tagged website, which takes them to an external website. This is what happens when the user clicks the link:

ga4 user clicks

What Are the Event Parameters in GA4?

Event parameters add depth to the data about how users interact with your website, highlighting specifics like product names, categories, and prices.

Consider the “video_play” event as an example in GA4. This tracks video plays, but, to grasp the full picture, you need the right parameter:

  • video_play event: Captures every time a video starts playing.
  • video_name parameter: Offers data on the specific video played.

Or when a user submits a form, triggering the form_submit event:

  • form_submit event: Covers each form submission on your site. On its own, it tells you how often forms are submitted.
  • form_id parameter: Enriches the event by identifying the specific form submission.

UA only allowed two to four parameters per event. GA4 allows up to 25, varying by event, offering even broader insights.

Types of Google Analytics 4 (GA4) Events

GA4 has four event types: two collected automatically (automatically collected events and enhanced measurement events), and two that you must manually implement in Analytics (recommended events and custom events).

1. Automatically Collected Events

Automatically collected events occur systematically and can’t be turned off. Some automatic events include:

  • first_visit: Detects a user’s first visit to your site.
  • session_start: Marks the beginning of a session.
  • user_engagement: Captures engagement metrics, such as time spent on the site.

These events provide a solid foundation for understanding basic user interactions across your digital platforms.

ga4 session start event

2. Enhanced Measurement Events

Enhanced measurement events provide insights into precise user actions. The GA4 interface allows for customization based on needs, and they are enabled through a toggle. 

Examples include:

  • scroll: Tracks when users scroll through a page.
  • form_submission: Records clicks on outbound links.
  • video_start: Captures when a user starts playing a video.

This allows for the collection of nuanced interaction data without requiring complex implementation.

3. Recommended Events

Recommended events capture data relevant to your specific industry or niche, requiring manual setup. Implementing these events helps gather additional features and behavior and generate more actionable reports.

Google recommends these events to all customers in all business verticals:

ga 4 events

These events are tailor-made to ensure you capture your business’s most relevant data.


Why is tracking events in GA4 important for brands?

“GA4 event tracking helps understand nuanced user interactions on websites and apps, from clicks to purchases. This granularity enables businesses to move beyond basic pageview analytics, providing insights into engagement quality and feature effectiveness. As we shift towards a more user-centric model of analytics, GA4 event tracking allows us to refine user experiences, enhance conversion rates, and ultimately drive greater business value through informed, data-driven decisions.”

Image Description

Director of Analytics, KORTX 

 4. Custom Events

Custom events offer the ultimate flexibility, allowing you to track virtually any action that doesn’t fit into the other categories. You define what to track, tailoring the event to your specific needs.

Unlike recommended events, Google doesn’t provide recommended names for your custom events.

Examples could be:

  • product_comparison_view: This event occurs when a user views the product comparison page.
  • subscription_trial_start: Fires when a user begins a trial subscription.
  • high_score_achieved: Triggers when a user reaches a new high score in a game.
  • virtual_event_signup: Activates when a user signs up for a virtual event or webinar.

Custom events, though more complex to set up, powerfully capture unique business interactions.


💡 Our Tip: When creating custom events, always consider your unique measurement goals.


📚 Essential Resources for Google Analytics 4

  • GA4 vs UA Introduction: Google Analytics 4 offers a modern take on analytics with its ‘App + Web’ approach, leveraging machine learning for richer insights beyond mere web activity.
  • UTM Tracking in GA4: Understand the shift from Universal Analytics hit types to GA4’s event-based tracking and how it impacts reporting.
  • GA4 Setup Checklist: Navigate the complex transition from UA to GA4 with a detailed migration guide, including potential obstacles and a timeline to meet the July 2024 deadline.
  • Archiving UA Data: Before moving completely to GA4, discover methods to archive your Universal Analytics data, ensuring no valuable information is lost.

How to Set Up Recommended & Custom Events in GA 4

After setting up Google Analytics and seeing initial data, you might crave deeper insights or new features. 

Google automatically handles automatically collected and enhanced measurement events. However, recommended and custom events require manual setup. 

Here’s how to set up both event types on your website via Google tag (gtag.js) or Google Tag Manager.

To start, this guide assumes that you have:

  1. Created a Google Analytics 4 account and property
  2. Created a web data stream for your website
  3. Placed the Google tag on your website
  4. Access to your website’s source code
  5. The Editor role to the Google Analytics account

Without these, you won’t be able to go any further in setting up your events.


📉 Need help setting up GA 4?
Our team can help!


 How to Set Up GA4 Events Using Google Tag Manager

Configuring events in Google Tag Manager involves creating a GA4 Event tag and setting up a trigger for the event. 

Here’s how to track a custom event, like a newsletter signup button click, without needing a data layer object.

Step 1: Create a GA4 Event Tag

First, you’ll need to set up a GA4 Event tag in Google Tag Manager:

  1. Navigate to Tags > New in Google Tag Manager.
  2. Name your tag (e.g., “GA4 Event – Newsletter Signup”).
  3. Choose the Google Analytics: GA4 Event tag type and configure it:
  4. Select Google Analytics: GA4 Event.
  5. In the Configuration Tag, select your Google Analytics: GA4 Configuration tag.
  6. In Event Name, enter a name for the event (“signup_newsletter”). This creates a new custom event, and the name will appear in your GA4 reports. 
  7. Option: To create a recommended event, use one of the predefined event names.

It might look like this:

Step 2: Create a Trigger

Now, establish a trigger for when the event should be sent:

  1. In the GA4 Event tag setup, click the Triggering section.
  2. Click the + button to add a new trigger and name it (e.g., “Trigger – Newsletter Signup”).
  3. Specify the event conditions. For a button click, you might use:
    • Under Trigger Configuration, choose All Elements.
    • Select Some Clicks and define the condition: “Click Text contains Sign up for the newsletter.” 

If you don’t see Click Text, click the first drop-down, then select Choose Built-In Variable. From the menu, select Click Text.

  • Save your changes.

Configuration will look similar to this:

Step 3: Preview and Test

Before going live, preview your setup:

  1. Click Preview in Google Tag Manager to test the event tracking. This allows you to see the recorded data when the newsletter signup button is clicked.
  2. Use preview mode to check your container’s changes before publishing them.

3. Then, click Submit.

From here, you can set up parameters for your events. To view this in more detail, check out Google’s video below:

 

How to Set Up Event Parameters in GA 4

To add detailed context to your events, follow these steps to set up parameters for your event in Google Tag Manager (GTM).

Step 1: Create Event Parameter Variables

  1. Navigate to Tags within GTM and select your GA4 Event tag.
  2. In Tag Configuration, find and expand the Event Parameters section.
  3. For Parameter Name, input your desired parameter name (e.g., “button_label”).
  4. Next to the Value field, click the Add variable icon to choose a variable representing the parameter value. (e.g., selecting “Click Text” captures the button’s text for button click events)

    If using a data layer object, hit the + at the top right to pick Data Layer Variable.
  5. Save your configurations and publish the container to finalize.

Step 2: Preview and Test Your Setup

Before officially launching your new event setup, click Preview. This lets you verify the data captured when interacting. Then, test your changes before publishing them to your website in preview mode.

How to View Events in Analytics

To see the tracked events and their details, check the Realtime and DebugView reports in GA4. Note that DebugView might need extra setup. These reports display the tracked events as they happen, offering real-time insights.

Getting the Most Out of GA4

As you refine your event tracking setup, remember the power of testing and customization in uncovering valuable data that can drive strategic decisions. With GA4, the potential to understand your audience and enhance your digital experience is boundless, setting the stage for informed growth and innovation.


Need help with GA4? Our team is here.

Our Analytics team is here to guide you through the process, providing expertise on platform differences and assisting with setting up custom events, tagging your site, and more.


About the Author

Josh Pettovello is a University of Michigan graduate who enjoys all things data, SEO, and nerding out.

...
Josh Pettovello
Share:

Latest Stories

Here’s what we've been up to recently.

Get our stories delivered

From us to your inbox weekly.