How to track text, email or button clicks using events in Google Tag Manager
Time to Learn: 20 Minutes
Time to do: 5 Minutes
Text or button click tracking on a website will give you an insight into user behaviour. Many websites have contact forms that you can track to see which channels are driving you the best traffic, however, some website visitors may choose to contact you directly by email.
>Learn how to track completed forms on your website here
This guide will teach you how to set up a button or email click as a goal in Google Analytics by using Google Tag Manager. So let’s get started!
Before you start you will need top-level access to the following accounts:
- Google Tag Manager
- Google Analytics
- Google Tag Assistant
Important! Google Analytics must be set up in Google Tag Manager for this to work.
How to track email text clicks
On occasions, website visitors instead of filling out a contact form, will want to contact the company or an individual team member and so they’ll usually do this by either calling them or emailing them. To email they will likely click on the “email” button or email address in their profile or on the contact page like below.
By tracking this button click via Google Tag Manager you will discover
- Which traffic source it came from i.e Organic, Direct, Referral, Social, Paid or other
- Whether there were more than 1 traffic sources involved in the whole customer journey to conversion
- Which website page they clicked the email text on
- What time and date the click was made
Google Tag Manager Set Up For Click Tracking
Step 1 – Activate Click Variables
First off, we need to activate the click variables in Google Tag Manager, since this variable if not set up as standard.
To do this, simply click on the “Variables” button on the left menu, then “Configure” and then scroll down to the “Clicks” and tick them all.
Step 2 – Set up a Trigger in Google Tag Manager
To set up a trigger in Google Tag Manager follow these three steps.
- Click on the Triggers tab on the left navigation bar
- Give the Trigger a name “Email Text Tracking”
- You will then be prompted to “Choose a Trigger Type. Select “All Elements”
- Select “Some Clicks” and from the first drop down select “Click Target”
- Select “Contains” and then enter “mailto”
Step 3 – Creating a tag for your trigger
Now you have your Trigger set up you will need to create a Tag for it so you can add it to the website and test.
- Click on the Tags button in the left-hand navigation
- Create a New tag by clicking on the red button
- Give your Tag a name
- The Tag type is “Universal Analytics”
- Click on the lego looking icon in the box and select your constant variable “Google Analytics”
- Type in the Category
- Type in the Action
- In the Label select “Page Path”
- Select “Google Analytics Settings” (if you haven’t set up GA yet, you will be able to here)
- Then below this screen select the TRIGGER you created in STEP 2
Step 4 – Testing your Trigger and Tag
Great! You are now ready to see if your Trigger and Tag have been set up properly and is working as it should.
To test your tag out, click on the arrow to the right of the PREVIEW button and then head over to your website and refresh the page, so you see the white “Debug” bar at the bottom. (If it does not appear you have not properly added your GTM code – speak with your developer)
Click on the “email” text button on your website and you will note that the GA Event you set up appears. All good? Head back to Tag Manager and PUBLISH (see image).
Didn’t appear? click on the variables (after you click on the text email) and see which settings you need to change. See below not many options are available but we can track the “Click Text” firstname.lastname@example.org
Head back to GTM and change the click trigger type with the following settings:
If it doesn’t appear again you will have to go back and find where you went wrong.
This is the same process if you wanted to track any other button or text click that is an outbound link. For example, a link to an external website or social media profile.
Note: If you want to track all email text clicks across the whole website, then just include @yourwebsite.com in the above Trigger Configuration.
Step 5 – Adding your email button click as a goal in Analytics
The final step you will need to do is to set up a goal in analytics. So head on over there and in Admin > Goals create a new one
Then set up the goal by…
- Selecting “Custom Goal”
- Give it a name (can match GTM Tag name)
- Copy the information over from GTM into the Category and Action fields
- Leave the Label and Value blank
- Give a value to the Event Goal (£50 for example)
There you have it, you will now be able to track website visitor email or text clicks. If this has been helpful or you need further help then please leave a comment below. Happy tracking everyone!