A Comprehensive Guide to Setting Up Custom Events in Google Analytics 4 (GA4)
Rafi Chowdhury
Business Analyst | IAM | Okta Certified Professional | Google Analytics 4 Certified | SailPoint | SSO | MFA | Agile & SDLC | Project Management | API Integrations | Data Analytics | Power BI | Tableau | SQL | CRM
Re-written by Nazmus (Rafi) Chowdhury | July 30, 2024
In this guide, I’ll walk you through the process of creating a custom event in Google Analytics 4 (GA4). Custom events are essential for tracking specific interactions on your site that aren’t covered by default events. Whether you’re looking to monitor user behavior more closely or gain insights into unique aspects of your website, setting up custom events allows you to tailor your analytics to meet your needs. Follow along as I detail each step to help you effectively configure and implement custom events in GA4, ensuring you capture the data that matters most to your business.
Events represent the most significant change from Universal Analytics (UA) to Google Analytics 4 (GA4). This shift is crucial and offers both challenges and opportunities. As a property owner, you must reassess your analytics strategy and adapt to the new system. Instead of merely replicating your UA dashboard in GA4, defining your specific analytics needs is more beneficial and taking advantage of GA4’s enhanced flexibility to meet your objectives. This proactive approach will help you make the most of the transition before UA’s End of Service date on July 1, 2023.
GA4 events provide more versatility
GA4 is built around events, which track user interactions in detail, unlike UA where screen views were the main metric. In GA4, events help you understand not just how many people visit your site, but also what they do while they're there. There are four main categories of events in GA4:
We'll guide you through using enhanced and custom events. Your experience with GA4 will largely depend on how you implement these events on your property.
Although transitioning to a new system can be challenging, developers find that GA4 offers significant benefits once you become familiar with it. Here’s why GA4 is a step up from UA:
How do I set up events in GA4??
Editing your own events in GA4 can significantly expand your options as a property owner, but it's important to consider a few factors. Assess how much effort it will take to achieve your desired results and what resources you'll need. Start by auditing your current UA setup and clarifying what you hope to gain from GA4. Then decide which tasks you're comfortable handling yourself and which might be more cost-effective to delegate to a developer.
We'll cover two methods for adding custom events:
Review the steps for both methods to determine which suits your needs best.
Starting steps: automatic events & Enhanced Measurements
Regardless of which method you choose for adding custom events, here are some important steps to follow:
You can further choose what types of things enhanced measurements are tracking by selecting the cog and toggling on what is most relevant for your business. Enhanced measurements let you track special engagement events like scrolling, outbound clicks, and file downloads.?
Customizing existing GA4 events
If the automatic events and enhanced measurements don’t fulfill all your needs, you can customize those events to track more specific interactions without adding any additional code to your tag manager or site. This creates a new custom event with your parameters and is part of the non-developer tasks anyone with owner access to your property can set up. Here’s an example of how to create a custom event created from an existing event:
1.?Go to Admin, and under Property, select Events. Select “Create event” at the top right of your screen. This brings you to a list of your custom events. Select “Create” at the top right of the screen again.
2: In the custom event name field, enter a name for your event. You’ll see a dropdown menu of existing events which can serve as a reference for your naming convention. It’s best to base your custom event name on these existing events, but ensure that your name is unique. Be specific and concise, making sure the name clearly describes the event's purpose. Remember that the name you enter will be used exactly as typed (case-sensitive) when configuring the event in the future. For instance, if you want to track when someone views a page related to library projects on your site, you might name your custom event “library_lead.”
After naming your event, you will need to establish conditions. First, select the existing event you want to track, such as "page_view." Then, add a specific parameter to refine your tracking. For example, use the operator “contains (ignore case)” to create a condition where the custom event triggers whenever someone visits a page with "library" in the URL. In GA4, the default parameter tracked in reports is “page_title,” but “page_location” tracks the URL, similar to what you might be accustomed to in UA. Since we have multiple pages with “library” in the URL, we want to capture the broader traffic to this type of content. You can be more specific if needed, as each custom event can have up to 25 new parameters.
领英推荐
Once you've set all the parameters to match the conditions for your event, review the Parameter configuration section. The “Copy parameters from the source event” checkbox is selected by default. This option is usually preferred, as it copies the existing parameters from the base event (in this case, “page_view”) you are customizing. However, if you need to modify these parameters, you can do so in this section.
Creating new events through Google Tag Manager (GTM) offers a flexible and precise way to track user interactions, beyond what's available in the GA4 interface. Although this method is more complex if you’re not familiar with GTM, it allows for more detailed event creation. You may choose to set this up yourself or seek help from a developer.
One advantage of using GTM for custom events is the ability to define specific triggers for your events. For example, if you have a button on your homepage that redirects users to your contact page and you want to track interactions with it, you can set up an event that monitors user actions with that element. Here’s how to do it:
By following these steps, you can create a precise and customized event in GA4 using Google Tag Manager.
11. Save the changes, and then we are ready to test the new GA4 event!
Before publishing the GTM changes, it is a good idea to use the “Preview” feature to confirm everything is working as expected. Then use the GA4 Realtime reports and debugging screen to ensure the event is tracking as desired.
If you want to explore creating events using Google Tag Manager (GTM), Google provides a helpful list of "recommended events" that you can add to your property. This is a good starting point as it offers suggestions for various business types and can guide you before you start creating your own custom events.
Tracking High-Value Events Through Conversions
Once you have your custom events set up, you might want to mark certain ones as conversions. Conversions allow you to track how visitors transition into customers, whether through sales, subscriptions, contributions, or any other metric that defines a high-value interaction for your business.
To mark an existing event as a conversion:
While it may take a few minutes for data to start appearing under your conversion tab and reports, the process is straightforward and quick to implement.
Keep in mind that you can only have 30 registered custom conversion events per property in GA4. However, you can delete old ones to make room for new ones as needed. Remember, not everything needs to be (or should be) marked as a conversion.
Google's primary goal in encouraging conversion tracking is to help you buy more effective ads from them, ultimately generating revenue from GA4. They’ve streamlined the process of porting this data into Google Ads to improve your company’s bidding strategies. Even if you aren’t purchasing ads or your site isn’t focused on eCommerce, you can still use conversions to track high-value interactions. This can be a valuable tool for customizing and enhancing your reports.
Where do I view my custom events??
Once your new events are set up correctly, they will be integrated into the native reports dashboards in GA4. You can customize your landing page by dragging and dropping widgets to prioritize your snapshot view.
You can also customize the reports themselves from this view, including changing the dimensions of the report or the visualization.
Events and conversions each have their own reports page under Engagement. This view is a broad and comprehensive look at all the events you’ve added to your property and everything you’ve marked as a conversion, so you might need to dig down a bit if you want more specific reports.?
If you’re used to UA, the new reports page might be a bit of a stumbling block because it doesn’t look the same as what you’re used to. Remember that this is a new opportunity, and take the time to explore the possibilities of a new setup. It’s simple to toggle different views, and you may find it easier to track down specifics.
If you have any questions or need assistance with creating an event in Google Analytics, feel free to leave a comment or reach out through my website, rafichowdhury.com. I'm always happy to help!