Set up Custom Events in Google Analytics 4 Like a Pro (2021)

Webomonk is supported by our readers. When you purchase via links on our site we may earn a commission. Read more
Set up custom events in Google Analytics 4 using Google Tag Manager
Events are user interactions/activity with content that you can measure in Google Analytics. It is so easy to set up custom events in Google Analytics 4.

There are events already, which comes under enhanced measurement. These are the automatically collected events that google already provides you, Some of these are click, page_view, scroll, etc.

To set up custom events in Google Analytics 4 Using Google Tag Manager follow the steps below:

Step – 1: Log in to your Google Tag Manager Account and click on ‘tags’ from the left side menu.

Step – 2: Click on the ‘New’ button to create a new tag.https://webomonk.com/

Step – 3: Name your tag as ‘Button Click’ and Click on ‘Tag Configuration’.
A ‘Choose tag type’ side menu will open up on the right-hand side with the list of all the available tag templates.
Step – 4: Click on ‘Google Analytics: GA4 Event’.
Step – 5:  In Tag Configuration Settings, Click on the ‘Select Configuration Tag’ drop-down menu.
Step – 6: If you have already set up a GA4 configuration tag, then select THAT tag, else select ‘None – Manually Set ID’.
From Your Google Analytics 4, Click Admin > Data Streams > Select Your Data Stream and Grab the Measurement ID. As shown below.
Step – 7: Enter your Measurement ID in the ‘Measurement ID’ input field.
Step – 8: Enter ‘Button Click’ in the ‘Event Name’ input box.
The event name provided here will appear in your Google Analytics 4 reports.
Step –  9: Click on the ‘Event Parameter” and then click on the ‘Add Row’ button.
Now, you will see two new boxes, ‘Parameter Name’ and ‘Value’.
Step – 10: Type ‘button_name’ in ‘Parameter Name’ input box.
Step – 11: Click on the ‘+’ button next to the ‘Value’ input box.
Step – 12: Select the ‘Click Text’ variable from the ‘Choose a variable’ menu.
If you followed it right, the final set up may look like the one below.
Step – 13: Click on the trigger button to make a new trigger.
Step – 14: Click on the ‘+’ sign at the top right-hand side of the ‘Choose a trigger’ menu.
Step -15: Name your trigger for the event and click on ‘Choose a trigger type to begin setup’.
Step – 16: Select the ‘All Elements’ from the trigger type.
Upon selection of All elements, your setup will look like the one below.
Step – 17: Now, click on the ‘Some Clicks’ radio button.
Step – 18: Set the trigger condition, as shown in the image below.
Wait?
What we just did? 🤔
Let me explain, here the trigger will fire only when the ‘Click Classes’ contains the ‘add-to-cart-btn’ class.
Note: You need to find the class name of the button that you are creating the event for. Don’t use the class name that I have used above.
Step – 19: Click on the ‘Save’ button on the right-hand side of your screen to save the new trigger.
Your entire tag set up should look like the one below.
Step – 20: Click on the ‘Save’ button at the right-hand side of your screen, to save the new tag.
Step – 21: Now, click on the ‘Preview’ button.
A new tab will open automatically with GTM Preview Mode.
Step – 22: Next, add the URL of the page where the button you want to track is available. And then hit the ‘Start’ Button.
Now, you will be redirected to the new tab which shows the page whose URL you typed.
Below is the page I used.
My page has this ‘Add to cart‘ Button. I am going to track clicks on this button.
Step – 23: Click on the button.
Step – 24: Head back to the GTM preview window and check whether or not your tag is fired on the click event.
As you can see above, the ‘Button Click’ tag was fired 2 times, because I accidentally clicked on it twice. 😄
Step – 25: Click on the ‘Button Click’ tag and you will see the ‘Tag details’ like below.
Step – 26: Now, go to Google Analytics, and open the ‘Real Time’ report from the left-side menu.
You will be able to see the ‘Button Click’ event being reported in GA4.
Kudos 🎉
You have successfully set up a custom event for GA4 using Google Tag Manager.
Close the GTM preview mode browser window and come back to the Google Tag Manager window on your browser.
Step – 27: Click on the ‘Submit’ button to publish your changes.
Step – 28: Type the ‘Version Name’ and hit the ‘Publish’ button.
Pro Tip: Whenever I publish a new tag on Google Tag Manager. I always give it a unique name that will help me understand, what changes I made at that particular version change. If you are a big organization with many people on the same account, this practice helps a lot in understanding previous changes and installations in Google Tag Manager.
Now, Sing like No one is listening.

Comment, if the article helped you in set up custom events in Google Analytics 4. Contact, if you any questions.