How to set up Custom Events in GA4 via Google Tag Manager

Custom events are the events in GA4 (Google Analytics 4) that you create and use. 

Google recommends that before you create a custom event, make sure that there is not an automatic, enhanced measurement or recommended event that already provides what you need.

To set up custom events in GA4 via Google Tag Manager follow the steps below:

Step-1: Log in to your GTM account and then click on ‘Tags’ in the left-hand side menu:

 

Step-2: Click on the ‘New’ button to create a new tag:

 

Step-3: Name your tag ‘Button Click’ and then click on ‘Tag configuration’.

An overlay will appear at the right-hand side with a list of tag templates:

 

Step-4: Click on ‘Google Analytics: GA4 Event’.

 

Step-5: Click on ‘Select Configuration Tag’ drop-down menu:

 

Get the E-Book (50 Pages)

Get the FREE E-Book (50+ Pages)

 

Step-6: If you have setup configuration tag then select that tag, otherwise select ‘None- Manually Set ID’ from the drop-down:

 

Step-7: Enter the Measurement ID in the input box:

You can find your measurement ID in the ‘Admin’ section under ‘Data Streams’.

 

Step-8: Enter ‘Button Click’ in the ‘Event Name’ text box:

The event name you provide here will appear in your GA4 reports.

 

Step-9: Click on the ‘Event Parameters‘ drop-down menu:

 

Step-10: Click on the ‘Add Row’ button:

 

You should now see the two new text boxes: ‘Parameter Name’ and ‘Value’:

 

Step-11: Type ‘button_name’ in the ‘Parameter Name’ text box:

 

Step-12: Click on the ‘+’ button under the ‘Value’ text box:

 

Step-13: Click on the ‘Click Text’ variable:

 

Your final set up may look like the one below:

 

Note: Adding event parameters to the event is optional.

 

Step-14: Click on the trigger button to create a new trigger:

 

Step-15: Click on the ‘+’ button at the top right-hand side of your screen:

 

Step-16: Name your trigger and then click on ‘Choose your trigger type’ button:

 

Step-17: Click on ‘All Elements’ trigger type:

 

 

Step-18: Click on ‘Some Clicks‘:

 

Step-19: Set the following trigger condition:

 

Here the trigger condition will fire the tag only when the click classes contains ‘readmore-btn’

You would need to find the class name of your button element. Don’t use the class name that I have used. 

 

Step-20: Click on the ‘Save’ button (at the top right-hand side of your screen) to save your new trigger.

Your entire tag set up may look like the one below:

 

Step-21: Click on the ‘Save’ button (at the top right-hand side of your screen) to save your new tag.

 

Step-22: Click on ‘Preview’ button:

A new tab will open with GTM Preview Mode.

 

Step-23: Add the URL of the page where the button you want to track is available and then click on the ‘Start’ button:

 

You will now be automatically redirected to a new tab in your browser window which shows the web page whose URL you typed.

In my case the page looks like the one below:

It contains a ‘Read More’ button. I am going to track clicks on this button.

 

Step-24: Click on the button.

 

Step-25: Navigate back to the preview window of GTM and check whether or not your tag is fired on the click event:

As you can see from the screenshot above, our button click has fired.

 

Step-26: Click on the ‘Button Click’ tag. You should now see the ‘Tag Details’ page like the one below:

 

Step-27: Navigate to the ‘Realtime’ report of your GA4 reporting view:

 

You should now be able to see the button click event being reported by GA4:

 

Congratulations, you have successfully set up a custom event for GA4 using Google Tag Manager.

After 12-24 hours have elapsed, your button click event should appear in your ‘All Events’ report:

 

Other articles related to GA4 (Google Analytics 4)

#1 Google Analytics 4 Intro

  1. What is Google Analytics 4 (GA4) – The Apps + Web Property
  2. How to upgrade to Google Analytics 4 (GA4)
  3. Google Analytics 4 (GA4) vs Universal Analytics – What is the difference?
  4. Google Signals for GA4 – How to see gender, interest and age data in Google Analytics 4
  5. Understanding Measurement ID in GA4 (Google Analytics 4)
  6. Google Analytics 4 training and tutorial

#2 Google Analytics 4 Integration

  1. How to connect GA4 (Google Analytics 4) with Google Data Studio
  2. How to connect GA4 (Google Analytics 4) with Google Ads
  3. How to connect GA4 (Google Analytics 4) with BigQuery

#3 Google Analytics 4 Events

  1. How to set up event tracking in GA4 (Google Analytics 4)
  2. How to setup enhanced measurement tracking in GA4 (Google Analytics 4)
  3. All Events Report in Google Analytics 4 (GA4)
  4. How to create user properties in Google Analytics 4 (GA4)

#4 Google Analytics 4 Conversions

  1. How to set up conversion tracking in GA4 (Google Analytics 4)
  2. How to import conversions from GA4 property to your Google Ads account

#5 Google Analytics 4 Ecommerce

  1. How To Set Up Ecommerce Tracking in GA4 (Google Analytics 4)

#6 Google Analytics 4 Specialized Tracking

  1. How to set up cross-domain tracking in GA4 (Google Analytics 4)
  2. How to set up site search tracking in GA4
  3. How to set up scroll tracking in GA4

#7 Google Analytics 4 filters

  1. What are data filters in Google Analytics 4 (GA4)?
  2. How to create and test a new data filter in Google Analytics 4 (GA4)?
  3. How to block internal traffic in GA4 (Google Analytics 4)

#8 Google Analytics 4 Advanced

  1. Analysis Hub Google Analytics – How to use the Exploration Report in GA4
  2. How to use Debug View report in Google Analytics 4 (GA4)
  3. Introduction to Measurement Protocol in Google Analytics 4 (GA4) – Version 2
  4. How to create a remarketing audience in Google Analytics 4 (GA4)
  5. How to create a custom audience in Google Analytics 4 (GA4)
  6. How to build comparison (Advanced segment) in Google Analytics 4 (GA4)

#9 Google Analytics 4 Reporting

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!