If you have been following the tech news lately, you must have definitely heard about the newest iteration of Google Analytics known as GA4. According to a statement made by Google in March last year, The GA4 will entirely replace the existing Universal Analytics (UA) for collecting data from July 1, 2023, onwards. However, users can still use the UA till the deadline. Unlike sessions in the UA, data is collected and tracked as events in GA4.
The thing about GA4 recommended events is that it allows you to measure a specific interaction or occurrence that happened on your website or app. For example, when a particular person loads your website or clicks a link which redirects them to another page, the whole interaction can be measured through events. For instances such as purchases, app crashes, etc, the appropriate events can be measured. When it comes to events, there are several types, however, in this article, we’ll be explaining recommended events GA4 and how they are tracked, let’s get started.
Types of events
Before diving into recommended events GA4, it is worth knowing about the other major events first and their purpose in the first place. In GA4, there are mainly four types of events which are listed below. As each event consists of several sub-events with each having its official definitions, it is worth checking the official GA4 events documentation to better understand the differences between each type.
Automatically collected events
These events are collected by default when you first set up Google Analytics on your website or app.
Enhanced measurement events
These events are collected automatically when you first set up Google Analytics on your website or app and enable the enhanced measurement option.
Recommended events
Unlike the other events which are collected by default, to collect and track recommended events GA4, those events require your implementation first.
Custom events
As the name implies, these events are defined and implemented for custom purposes. Like the GA4 standard events, these too require implementation first.
How GA4 recommended events work?
The process of implementing names, parameters and tracking events must be done in the following order.
- Check if the event is among the automatically collected events
- If not, then check if your event is among the Enhanced Measurement events
- If not, then check the GA4 standard events and their parameters
- If the event is in none of the above categories, create a custom event with an event name that you want
When it comes to GA4 recommended events, they do not automatically get triggered and logged unless manually implemented. The exact same event name and parameters described by Google must be used if you want the recommended events to work as intended. Failing to do so will result in Google not recognizing your event as one of the GA4 recommended events. Eventually, your particular event may not work or get triggered at all. Google has published several categories based on different business requirements. You need to know that GA4 standard events use the snake_case naming convention. This must be considered when naming your events and parameters.
Generic
- ad_impression : an ad impression is seen by the user
- sign_up : Measuring the popularity of each sign-up by the user
- join_group : Measuring the popularity of each group joined by the user
- login : a user logs in
- purchase : a user completes a purchase
Online sales
- add_payment_info : a user submits their payment information
- add_shipping_info : a user submits their shipping information
- add_to_cart : a user adds items to the cart
- add_to_wishlist : a user adds items to a wishlist
- begin_checkout : a user begins the checkout
Games
- earn_virtual_currency : virtual currencies earned by the user
- unlock_achievement : a user unlocks an achievement
- level_end : signifies level completion
- level_start : starts a new game level
For the complete list of events and their purposes, you can check the GA4 recommended events documentation and see if the event you want to track is listed. Before implementing any event, this page must be checked first. Alright, let’s see how to track recommended events in GA4.
Tracking recommended events GA4
As mentioned above, the thing about recommended events unlike automatic & enhanced events is that they have to be first configured using the predefined event names and parameters. Alright, let’s start with tracking a simple login in recommended events GA4, where should we start? First, we must begin by searching for the parameters in the event list. From the screenshot attached above, we can see there is a login event listed on the
all Properties section. Clicking on it takes you to a developer page where more details about the event are shown such as the parameters you can send with it.
Here, for our login event, we can use the method parameter. This indicates the actual method to be used for login purposes which can be Facebook, Google, Email, Phone, etc. depending on your business needs.
Let’s consider the sample code
gtag(“event”, “login”, {
method: “Google”
});
By adding the dataLayer.push code, the data is sent through the login method i.e. Google when the user logs in.
window.dataLayer.push({
“event”: “login”,
“method”: “Google”
});
The next step is to create a custom event trigger for the login event and a data layer variable which will access the value of the method. Both can be created by logging onto your GTM (Google Tag Manager)
- To create triggers, open Google Tag Manager, go to Triggers > New > Custom Event, enter the following settings, and press Save:
- For creating variables, go to Variables > User-defined variables > New > Data Layer Variable and enter the following settings:
After both these processes are done, the next step is to create a new tag that fires an event.
- Go to your GTM account and click on the Tags tab.
- Click on the New button and select Google Analytics: GA4 Event.
- Enter your GA4 measurement ID in the Configuration section.
- In the Event Name field, enter the name of the recommended event you want to track.
- In the Event Parameters section, enter the values for the event parameters, this part is optional.
- In the Triggering section, select the trigger that will fire the event.
- Click on the Save button.
After the successful creation of the GA4 tag and configuration, it’s time to test the events by debugging so as to ensure that it’s running without issues. DebugView is the primary feature built for debugging GA4 data. You can find it by going to GA4 Admin > Debugview. Once the data starts coming in and is displayed, the GA4 changes must be submitted in the GTM container and published. If everything is done correctly, you should start seeing new data coming in your real-time report.
Winding up
If you are looking for a convenient way to measure user interactions on your website or app, getting started with recommended events GA4 is the obvious choice. If you want to track an event with GA4, you should first check whether that event is already there in both automatic tracking and enhanced measurement. If not, then check the list of GA4 recommended events. The purpose of these events is to help google analytics better understand what kind of data you are sending in and in which reports to display it.
Related Post
Publications, Insights & News from GTECH