How to Set Up Click Event Tracking in GA4: A Step-by-Step Guide Using GTM

Published:
Last Updated:
Category: Web Analytics
Authors: Shusaku Yosa

Published:
Last Updated:
Category: Web Analytics
Authors: Shusaku Yosa
Understanding how often the buttons and links on your website are clicked is essential for improving CTAs and boosting conversion rates. In GA4 (Google Analytics 4), you can flexibly measure specific clicks as events by using Google Tag Manager (GTM). This article first clarifies what a GA4 click event is, then walks through the concrete GTM setup steps in order of variables, triggers, and tags. It also covers checkpoints for when measurement isn't working and cautions for avoiding double counting.
A GA4 click event is an event that records the action of a user clicking an element on your site, such as a button, link, or image. By measuring which elements were clicked and how often, you can understand user behavior and evaluate the effectiveness of CTA buttons and content.
There are broadly two approaches to click measurement in GA4. One is the outbound click (clicks on external links) that is automatically measured by GA4's 'enhanced measurement.' The other is a 'custom event' that you define independently for any element using GTM. When you want to measure clicks that enhanced measurement cannot cover, such as specific CTA buttons or internal links, you need to set up a custom event in GTM.
Before setting up a click event in GTM, check that the following preparations are in place.
If these are not set up, you first need to complete the basic GA4 and GTM setup. Once your preparations are ready, let's move on to the actual configuration.
Here we explain the GTM setup steps using an example of measuring a specific button click under the event name 'cta_click.' The overall flow has five steps: enabling built-in variables, creating a trigger, creating the GA4 event tag, verifying operation, and publishing.
GTM comes with pre-prepared 'built-in variables' for obtaining information about the clicked element. First, enable these. From the left menu in GTM, open 'Variables' and click 'Configure' under 'Built-In Variables.' From the displayed list, check items in the 'Clicks' category such as Click Element, Click Classes, Click ID, Click Text, and Click URL. Which variables you use depends on what you want to measure, but enabling the click-related variables together makes later configuration more flexible.
Next, create a trigger that defines which clicks to treat as events. From 'Triggers' in the left menu, choose 'New,' and for the trigger type select 'Click - All Elements' or 'Click - Just Links.' If you want to measure elements other than links, such as buttons, choose 'All Elements.'
Then select 'Some Clicks' and specify conditions to narrow down what to measure. For example, if the target button's ID is 'cta-button,' set 'Click ID equals cta-button'; if it's an element with a specific class, set 'Click Classes contains button_click.' Making the conditions specific lets you accurately measure only the clicks you intend.
Once the trigger is ready, create a tag that sends data to GA4. From 'Tags,' choose 'New,' and for the tag type select 'Google Analytics: GA4 Event.' For 'Measurement ID,' specify the measurement ID you copied from the GA4 admin screen (or your GA4 configuration tag).
For 'Event Name,' enter the name used to identify the event in GA4. Here we use 'cta_click' as an example. Specify the event name using half-width alphanumerics and underscores, and avoid GA4 reserved words. As needed, you can add 'event parameters' to send information such as the clicked button name or URL together. For example, if you set the built-in variable Click URL as the value for a parameter named 'link_url,' you can later analyze which link was clicked. Finally, set the trigger you created in Step 2 as the tag's 'Trigger.'
Once configuration is complete, always verify operation before publishing. Click 'Preview' in GTM to launch preview mode (Tag Assistant), enter the target site's URL, and connect. Actually click the target button and confirm that the tag you created is 'fired.' It is also reassuring to open GA4's real-time report and check that the event name you set is being measured.
Once you have confirmed that it fires without issue in preview, click 'Submit' at the top right of the GTM screen to apply the settings. When you enter a version name and description and publish, click event measurement begins on the actual site.
If you have set things up but the event is not measured, check the following points in order.
Something to be especially careful of when setting up click events in GTM is double counting due to overlap with GA4's enhanced measurement. GA4's enhanced measurement automatically measures things such as outbound clicks to external links. If the trigger conditions of the custom event you set in GTM overlap with the targets of enhanced measurement, the same click may be recorded twice.
To prevent this, either disable the relevant item in enhanced measurement, or narrow the trigger conditions on the GTM side so that they do not overlap with enhanced measurement targets. It is important to clarify the purpose of your measurement and organize which method you will use to measure.
With GTM, GA4 click events let you flexibly measure clicks on targeted elements such as CTA buttons and any links. The setup flow is five steps: enable the click-related built-in variables, create a narrowed-down trigger, set the event name and parameters in the GA4 event tag, verify operation in preview, and then publish. If it isn't measured, review the variables, trigger, tag, and publish status in order, and also watch out for double counting with enhanced measurement. Once set up correctly, you can visualize users' click behavior and raise the precision of your site improvements.

An explanation of Access Analysis Kenkyujo, a free, high-functionality Japanese access analysis tool. Covers features li...

A guide to excluding IP addresses in GA4 to remove your company's access from measurement: the two-stage setup of defini...

Explaining what GA4's "(direct) / (none)" is: the mechanism by which the referral cannot be identified, causes such as b...