Step-by-Step Guide: Create Custom Events on GA4 with Google Tag Manager

Universal Analytics came to an end, and Google Analytics 4 will be the main character in the analytical context, thus, we need to start embracing all of its new features and procedures.

As a little background, in 1998, Urchin was the main analytics tool, which in 2005 was acquired by Google, and turned into Google Analytics. Since then, Analytics has been continuously improving. However, over the years its structure has become outdated and is unable to cater to the advanced requirements of marketers around the world. This is the reason why Google created GA4, a brand-new analytical platform designed for advanced customization throughout all your reports.

Coming back to the present, let’s explore how events are created in GA4. Before starting, we need to understand that there are four types of events that can be tracked in GA4:

  • Automatically collected events 
  • Enhanced measurement events
  • Recommended events
  • Custom events 

In this article, we will mainly focus on creating custom events using Google Tag Manager. Even though GA4 is already providing a comprehensive list of events, businesses can still create their own events in order to reach a certain granularity when reporting. 

Here is a step-by-step guide on how to create custom events on GA4 using Google Tag Manager.

Link your GA4 account to Google Tag Manager

Linking your GA4 account to Tag Manager is the first step, creating an informational bridge between the two platforms. In order to do so, you need to create a configuration tag. 

Creating the configuration trigger

By checking the triggers section, it is important to create a page view event, which will trigger all the pages throughout the whole website. You can easily name this event “GA4 Configuration” so you can keep track of what you are implementing.

Creating the Configuration Tag

Once you have the trigger, it is important to set up a tag which will let the trigger know how it should fire. In order to do so, go into the tags button and create a new tag, and choose Google Analytics: GA4 Configuration from the list. This is a specific tag that is only used to link the GA4 account with Tag Manager.

Once you arrive on this page, the last step is to add the add the measurement id, which can be found in your GA4 property, in Admin,  then Data Stream, press on the specific Data Stream you would like to track, and then paste  the measurement id into the Tag Manager section. The format will look like this G-XXXXXXX.  

Once this setup is finished, assign the trigger you created to this tag, and submit all your changes from the workspace..

Once this is created, you can start using Tag Manager properly, achieving granular reporting techniques.

Create an event in Tag Manager

Once the configuration works properly, you can start creating events. In this article, I will use as an example the creation of an event, which tracks all the internal clicks throughout the website. This is a feature that is quite important, and now, Google is only able to track external clicks, that are leading the user away from your domain.

As a result, this is a step-by-step guide, which will show you how to track your internal links and furthermore, customise this event in GA4 using the variables set up in Tag Manager.

Create an event trigger

The trigger is the action that you want your event to take when it fires, thus, we would like to track the internal buttons from your website. Based on how the buttons are created, you can choose either Just Links or All Elements

Just Links only tracks clicks from elements that use <a> in the HTML structure, whereas All Elements tracks images, buttons, and links, too. However, when a website has only links to track, it would be wise to use Just Links since this is a specific trigger provided by Google. Once the trigger is selected, since you have specific link clicks to be tracked, tick the “Some Link Clicks”, which will let you define the rules..

Below you can find how the setup should look, with Click URL being the variable that checks whether your clicks are leading to your domain or not.  

Creating an event tag

Once the action is set through the trigger, the tag is the part where we tell Tag Manager what information is to be sent by GA4, in order to furtherly customize the event in Google Analytics.

In terms of naming conventions, Google provides a list with the suggested event names. If none of those events is close to your goal, you can provide your own name; however, it is important to keep in mind these  GA4 naming rules

Once the event name is provided, the next step is to choose the Configuration Tag created previously and set up the parameters that GA4 will receive once the event is fired.

Event parameters 

The event parameters are additional information that can be used in order to further refine the event, using the GA4 interface.

In this case,  the most important parameters for internal clicks are the URL where the button is sending the user (Click URL)  and the text prompted on the button such as “Learn more”, “Enquire” etc.

The value of the parameter is the actual metric that will be sent from Tag Manager to GA4, and the parameter name is the way you would like to call it in GA4. This data has to be defined now, so Tag Manager can store all the required information. 

The image below describes the use of the Configuration Tag, Event Name, and Event Parameters.

Once this is completed, you need to save it and link the Tag with the Trigger created previously. The last step would be to submit all the changes from the workspace and wait between 24 – 48 hours to see your events in GA4.

Customising events created in Tag Manager using GA4

After 24 – 48 hours you should be able to find the event created in Tag Manager in GA4. From this point, you can furtherly customise your events using the parameters set up in Tag Manager. 

As a result, let’s go into the GA4 events and look for the name of the event created. You can find the list of all your events by going to Admin, and then Events. 

In this case, let’s use internal_click as the event name. Let’s say that on your website, you are interested in one single button specifically, which can potentially turn a visitor into a customer, for example, “Get in touch”. It would be great if you could only track this one. As a result, a new event can be created in GA4 by clicking on “Create event”.

It is important to add a descriptive name such as get_in_touch and set the event name to internal_click so GA4 knows based on which general event this customised event was created. 

Next, add the parameter created in Tag Manager, such as link_url, and type the exact page where the button should send the user to. In this case, since the button is called get_in_touch, it will probably lead to a contact us page, from where the client submits a form. 

As a result, this is how the event should look in GA4

After the event is created, press the save button and wait between 24 and 48 hours to find your custom event data in GA4.

You will be able to find this event under your Report section along with all the other events tracked on GA4.

Relevance is a luxury digital marketing agency that specialises in helping luxury brands target the world’s richest audiences. If you want tailored digital marketing strategies that harness the power of the latest tools, including GA4, contact our specialists. 

Read more articles by this author

click here