Ask any question about Analytics & Tracking here... and get an instant response.
How can I track button clicks as custom events in Google Tag Manager
Asked on Nov 13, 2025
Answer
To track button clicks as custom events in Google Tag Manager (GTM), you need to set up a click trigger and a corresponding tag to send the event data to Google Analytics 4 (GA4). This setup allows you to measure user interactions with specific buttons on your website.
<!-- BEGIN COPY / PASTE -->
1. Create a new Trigger in GTM:- Go to Triggers → New → Trigger Configuration → Click → All Elements.
- Configure the trigger to fire on specific button clicks (e.g., by CSS selector or button ID).
2. Create a new Tag in GTM:- Go to Tags → New → Tag Configuration → Google Analytics: GA4 Event.
- Set the Event Name (e.g., "button_click").
- Set the Event Parameters (e.g., "button_text" with a variable capturing the button text).
- Choose the GA4 Configuration Tag.
- Assign the previously created click trigger to this tag.
<!-- END COPY / PASTE -->Additional Comment:
- Ensure your GTM container is published after making these changes to activate the tracking.
- Test the setup using GTM's Preview mode to verify that the event fires correctly when the button is clicked.
- In GA4, navigate to Reports → Engagement → Events to see the tracked button click events.
- Consider using GTM's built-in variables to capture additional information about the button click, such as the button's text or URL.
Recommended Links:
