How to set up GA4 Custom Events 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 GA4 custom events 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 (100 Pages)

CSS selectors in Google Tag Manager


Get the FREE E-Book (62 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 GA4 Intro

  1. What is GA4 (Google Analytics 4) – The Apps + Web Property?
  2. Key Benefits of Using Google Analytics 4 (GA4)
  3. How to upgrade to GA4 (Google Analytics 4)
  4. Google Analytics 4 (GA4) vs Universal Analytics – What is the difference?
  5. Google Signals GA4 – See demographics (gender, age) in Google Analytics 4
  6. Understanding Google Analytics Measurement ID (GA4)
  7. Google Analytics 4 training and tutorial
  8. Using the GA4 test property

#2 GA4 Integration

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

#3 GA4 Events

  1. GA4 (Google Analytics 4) Event Tracking Setup Tutorial
  2. How to set up GA4 Custom Events via Google Tag Manager
  3. GA4 (Google Analytics 4) Enhanced Measurement Tracking Tutorial
  4. Events Report in Google Analytics 4 (GA4)
  5. GA4 User Properties (User Scoped Custom Dimensions) – Tutorial
  6. Event Scoped Custom Dimensions in GA4 – Tutorial

#4 GA4 Conversions

  1. GA4 (Google Analytics 4) Conversion Tracking Guide
  2. How to import conversions from GA4 property to your Google Ads account

#5 GA4 Dimensions and Metrics

  1. GA4 Metrics Tutorial with Free Google Analytics 4 Ebook
  2. GA4 Custom Metrics Tutorial
  3. GA4 Dimensions Tutorial
  4. GA4 Custom Dimensions Tutorial

#6 GA4 Ecommerce

  1. GA4 (Google Analytics 4) Ecommerce Tracking via GTM – Tutorial

#7 GA4 Specialized Tracking

  1. Cross Domain Tracking in GA4 (Google Analytics 4) Setup Guide
  2. GA4 Site Search – Tracking Site Search in Google Analytics 4
  3. GA4 (Google Analytics 4) Scroll Tracking Tutorial
  4. How to Install Google Analytics 4 on Shopify
  5. Self-referral Google Analytics 4 – Referral exclusion GA4
  6. GA4 Data Import Tutorial

#8 GA4 filters

  1. GA4 filters – Understanding data filters in Google Analytics 4
  2. How to create and test filters in Google Analytics 4 (GA4)?
  3. Exclude internal traffic in GA4 (Google Analytics 4) via IP filter

#9 GA4 Analysis Hub

  1. Analysis Hub Google Analytics – Exploration Report in GA4 (Google Analytics 4)
  2. How to use the user lifetime report in Google Analytics 4 (GA4)
  3. How to use path analysis report in Google Analytics 4 (GA4)
  4. How to use Segment Overlap Report in Google Analytics 4 (GA4)
  5. How to use the Funnel Analysis Report in Google Analytics 4 (GA4)

#10 GA4 Advanced

  1. How to use Debug View report in Google Analytics 4 (GA4)
  2. Understanding GA4 measurement protocol
  3. How to create a remarketing audience in Google Analytics 4 (GA4)
  4. GA4 Audiences – Creating custom audience in Google Analytics 4
  5. How to build comparison (Advanced segment) in Google Analytics 4 (GA4)

#11 GA4 Reporting

  1. How to create custom insights in Google Analytics 4 (GA4)

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 !!