As more and more website owners and marketers are transitioning to do all of their reporting in GA4, a lot of people are asking questions about how to execute certain tasks and pull over the reporting they were used to in Universal Analytics, feeling as though they need a custom Google Analytics dashboard or an advanced GA4 certification to understand how to use the platform.
Google has described GA4 as being “events based” so understanding custom events is obviously critical on the new platform. In this post we’ll walk through what custom events are, how to set them up, how to view them in reports, and how to update them if you need to.
What Are GA4 Custom Events?
According to Google, a custom event in GA4 is:
“an event that has a name and set of parameters that you define. A custom event lets you collect data that Analytics doesn’t otherwise collect automatically or recommend.”
Google defines events in GA4 broadly as an “interaction or occurrence” happening on your site, and as you might have guessed from GA4 being event and parameter based, virtually every website interaction falls under the “event” umbrella in the new platform.
Some events are what Google designates as default or “automatically collected events” which are events that are pre-configured by Google which will show up in your analytics account – you guessed it – by default.
Custom events, then, are events you need to configure on your own to measure specific interactions.
Examples of Custom Events in GA4
There are a variety of things you can create custom events around. Many of them will be points of conversion (downloads, form completions, etc.) and others may be custom engagement metrics you want to track (such as number of pageviews for a user, activity associated between a specific action and specific page path, etc.)
Here are some common examples of custom events in GA4:
- Button clicks
- Form submissions
- Video interactions
- Scroll depth
- File downloads
- Social media interactions
- External link clicks
- Product interactions
- Custom search
- User sign-ups
Again, custom events allow you to measure specific interactions on your site along these lines.
How to Set Up Custom Events in GA4
Once you’ve determined what you actually want to track and the specific custom event you want to create, an important thing to note is that there are two fundamental ways to create custom events in Google Analytics 4: with Google Tag Manager or in the Google Analytics interface.
We’ll walk through the process of setting up custom events via each method.
Setting Up Custom Events with Google Tag Manager
Setting up a custom event in Google Tag Manager is a multi–step process that will require the proper access to create tags and triggers in Google Tag Manager, as well as access to GA4 to create custom dimensions.
You can follow the standard process within Google Tag Manager to configure both a tag, and a trigger that’s associated with that tag that will trigger the tag.
This is a good walk-through of how to set up a tag in GTM:
From there, you then go back to the GA4 interface to set up a custom dimension so that an event will be triggered within GA4.
First, navigate to the admin area in GA4:
Then, click custom definitions and select the create custom dimensions button:
Then, you can assign your dimension name and description, and also highlight the parameter you created for your tag in Google Tag Manager.
If you’re looking to troubleshoot whether your event is set up correctly, you can check by using Google tag assistant and GA4’s debug mode after you run through the process of completing the process the event is attempting to measure.
Setting Up Custom Events with Google Analytics 4 (Directly in the Interface)
Setting up a new event within GA4 can be completed in a few steps.
First, navigate to the admin section of GA4:
Assuming you have the proper permissions, you can then navigate to the events and click create:
Then, click create again:
Once you click create, you’ll be taken to the screen where you can name your new event and configure the parameters you want to have in order for the event to fire:
When you create an event directly in GA4, you don’t need to create a custom dimension for it. As with events set up via Google Tag Manager, you can check to see if the event is firing properly by using Google tag assistant and GA4’s debug mode.
Custom Event FAQs
Here are a series of commonly asked questions related to custom events:
What Are Automatically Collected Events in GA4?
Automatically collected events are predefined events that are captured by default in GA4. These events include pageviews, scrolling, site search, video engagement, and outbound clicks. These events are automatically tracked by GA4 as long as the GA4 tracking code is installed on your website or app.
Automatically Collected Events vs. Custom Events: What’s the Difference?
The difference here is obviously that automatically collected events are set up within the default version of Google Analytics for each account, while custom events are events you can set up (either in Google Tag Manager or Google Analytics) to measure specific interactions on your site within your own GA4 profile.
What Are Enhanced Measurement Events in GA4?
Enhanced measurement events are events that are automatically tracked by GA4 when specific conditions are met. These events include file downloads, outbound clicks, video engagement, and scroll tracking. Enhanced measurement events can be enabled in the GA4 settings under the “Data Streams” section.
Enhancement Measurement Event vs. Custom Events: What’s the Difference?
Enhanced measurement events are specific variations of automatically collected events that can be turned on or off with in a Google Analytics profile, while custom events are events you set up deliberately within your Google Analytics account.
What are recommended events in GA4 and how do I use them?
Recommended events are a set of predefined events that are recommended by GA4 for tracking common user interactions. These events include “View Item,” “Add to Cart,” “Initiate Checkout,” and “Purchase.” Recommended events can be added to your GA4 implementation through the “Events” section in the GA4 interface.
Why are my GA4 Custom Events not showing up in my reports?
There could be several reasons why your custom events are not showing up in your GA4 reports. Some possible reasons include incorrect implementation of the custom event tracking code, a delay in data processing, or incorrect filtering or segmentation settings in your reports. To troubleshoot this issue, check your implementation, wait for data to be processed, and check your filters and segments in your reports.
What is the JavaScript Code Required for GA4 Custom Event Tracking?
The Javascript code required for GA4 Custom Event tracking is the “gtag()” function. This function sends event data to your GA4 account and can be customized to track specific user interactions. Here is an example of the “gtag()” function for tracking a custom event:
gtag(‘event’, ‘custom_event_name’, {
‘event_category’: ‘category_name’,
‘event_label’: ‘label_name’,
‘event_value’: 10
});
Is there a limit to the number of custom events I can create in GA4?
There are a number of limitations within GA4 related to custom events, a few to be aware of:
- You can only create up to 500 events
- You can only use up to 50 custom dimensions and metrics
- Event Name Length is Max 40 characters
- Length of Event Parameter Names Max 40 characters
- Length of Event Parameter Values Max 100 characters
- Number of Event Parameters Per Event Max 25
- Registered Custom Conversion Events Max 30
How do I use the dataLayer for GA4 Custom Event tracking?
To use the dataLayer for GA4 Custom Event tracking, you can push custom event data to the dataLayer using the “dataLayer.push()” function. This data can then be captured by the “gtag()” function and sent to your GA4 account. Here is an example of pushing custom event data to the dataLayer:
dataLayer.push({
‘event’: ‘custom_event_name’,
‘category’: ‘category_name’,
‘label’: ‘label_name’,
‘value’: 10
});
What are event parameters in GA4 Custom Events and how do I use them?
In GA4 Custom Events, event parameters are key-value pairs that provide additional information about the ways users interact with your website. These parameters describe the event in more detail and allow for more granular analysis of event data. By default, automatically collected and enhanced measurement events include parameters, and Google provides a set of required and optional parameters for each recommended event. You can also add more event parameters when needed.
To set up event parameters, you can use the gtag() function with the event command and include the parameter key-value pairs in the third argument.
Additionally, you can update the config command in the Google tag snippet to send parameters with every event on the page.
By using these parameters, you can see your events and their parameters using the Realtime and DebugView reports in Google Analytics, allowing you to analyze your data and gain insights into user behavior.
Create Your Own Google Analytics Dashboards
If you’re struggling with custom events in GA4 (or any aspect of GA4 or looker studio generally) you may want to transition to a ready-made Google Analytics dashboard.
If you’re using WordPress, the ShareThis Google Analytics Dashboard for WordPress can help you monitor your traffic and engagement for free with just a few clicks.