How to Set Up Custom Events in GA4 with GTM

Learn how yo set up a custom event in Google Analytics 4 by using Google Tag Manager with step-by-step guides

If you want to gather additional information beyond automatically collected events and enhanced measurement events in Google Analytics 4, you need to set up custom events in GA4 using Google Tag Manager (GTM).

Source: Google
Source: Google

While it's impossible to explain all possible custom events in a single guide, we will provide you with the general event setting rules and reasoning along with examples.

By following our step-by-step guide, you will understand how you can create your own custom events using Google Tag Manager (GTM) according to your specific requirements.

Before you begin, make sure you have already completed the following steps:

Set up Google Analytics 4
Here is the link for you: https://ga4.com/create-new-ga4-account-properties
Create a web data stream for your website
Check our guide to create data stream: https://ga4.com/how-to-create-and-adjust-data-streams-in-ga4
Add GTM snippets on your website
You can follow our beginner's guide for GTM setup: https://ga4.com/ga4-setup-gtm
Create a Google Analytics 4 Configuration tag
Please check this article to learn how to do: https://ga4.com/ga4-setup-gtm#set-up-google-analytics-4-configuration-tags

Please note that you must have access to the GTM container and the Editor (or above) role to the Google Analytics 4 account for the website.

In addition, using Tag Assistant to debug will be helpful in the following steps, so you can install chrome extension here .

GA4 Event Tracking with GTM

To send any custom event to a Google Analytics 4 property, in theory you need to apply these steps:

1. Create a GA4 Event Tag

Access your Google Tag Manager account and open the desired container. Create a new tag and select the Google Analytics: GA4 Event option.

    • To create a recommended event, you have to use one of the  predefined event names (e.g. add_to_cart).
    • If you want to create a special event that is NOT listed in recommended event names, enter a new custom event name (examples names: signup_newsletter, button_clicks, reviewlink_clicks).

2. Create a Trigger

Define the conditions for when you want the event to be sent. This could include specific page views, clicks, form submissions, or other user interactions. Choose the appropriate trigger type to fire the event.

  • Before configuring a trigger , make sure the related variables are activated. For example, if you want to track videos on your website, you should enable video variables. In our case, since we are creating a specific click event, we will activate all click variables. As a side note, the variables used in this example are built-in GTM variables .

Here's how you can do it:

    • Navigate to the Variables section.
    • Look for the variables related to your custom event tracking and enable them by clicking on the variable and selecting the checkbox.

3. Configure the GA4 Event Tag

Provide relevant information for the event, and customize the settings to match the specific event you want to track.

  • For custom events, Google Analytics: GA4 Event will be your type of tag.
  • Find a suitable name according to the user interaction you want to track.
  • In this stage, you can adjust additional settings such as Event Parameters and User Properties. For instance, let's say you want to track clicks on certain review links for a specific product. When you configure event tag, you may want to send additional parameters to have that specific review links. Therefore, you will create Event Parameter as shown below. ( Note: You can decide the name of events and parameters).

4. Save and Publish

Lastly, you need to save and submit the changes in Google Tag Manager. You must publish the changes to ensure they track your website.

How to Create GA4 Event with GTM?

Let's walk through an example of creating a custom GA4 event using GTM.

Assume that we want to track clicks on a button to sign up for our newsletter on our website.

Here is how we can track clicks on this specific button step by step:

Where to Find Custom Events in GA4?

Until custom events are registered in GA4, you won't be able to access the custom dimension data that GA4 received during that time. It's important to remember that the custom dimension data will be available 48 hours after these steps are done.

Register a custom definition in GA4

Now, let's register a custom definition:

Register a custom dimension "signup_newsletter"
Register a custom dimension "signup_newsletter"
Table Of Contents