Think of it like a big container and within that container is all of your scripts, such as Google Analytics, that you use to track visitors to your site or add other key functionality. Scripts that you might add to this container might include:
- Google Analytics
- Google Ads Call Tracking
- Hotjar
- Crazy Egg
- Mailchimp
- Optin Monster etc.
- Advanced Sitewide event tracking
Within your website code you only need to embed the GTM script which becomes the container for all of your other scripts.
1. Setup Variables
To start with, we need to add a new built-in variable to GTM that we’ll use to get the URL for a link that has been clicked.
1. The first thing you want to do is click on the variables tab and then hit the configure button.
2. Secondly you want to scroll down the list until you find Click URL, hit the checkbox next to this and then close the window.
That’s all you need to do with variables for now.
2. Setup The Link Trigger
The second part of configuring GTM for phone call tracking is to configure a trigger.
A trigger is a condition that evaluates to either true or false at runtime. Triggers are attached to a tag when the tag is fired or not fired. The Trigger is basically the mechanism that says “this telephone link has just been clicked” and the Tag responds by saying “I’ll generate an action to deal with it”.
Without the Trigger the tag will never fire. Make sense?
1. Select triggers from the tabs and then selection new
2. Give the trigger a name, anything you like, and select the option for “Just Links”
This says that we only want this trigger to fire when a link has been clicked. In our case we’re specifically concerned with links that contain “tel:” followed by a phone number.
3. Select Wait for Tags, leave the default 2 second time period, and then enter in the details as shown in the screenshot below.
The following settings are telling this trigger to fire when a link click occurs within any page on our site i.e. matches RegEx .*. However we want this trigger to only occur when clicking a “tel:” link so we need to add some additional information.
The second rule refines our trigger to fire only when the Click URL, i.e. the url of the link that was clicked, contains tel:
Once you’ve added the settings above you can hit the save button.
3. Setup The Tag
Now, the final step is to set up the tag.
Tags typically execute, or fire, when the page loads, or in response to some interaction on the page such as a trigger. As we’ve already configured the tel: trigger we can now assign that to our tag to specify what should happen when the trigger fires.
In our example we’re going to use the Tag to generate an event to Google Analytics.
1. Select tags from the tag and then select new
2. Give the tag a name, anything you like, and select the tag configuration. From the options select universal Google Analytics.
In our example we want to create a tag type using Google Analytics, because we’re generating a Google Analytics event. For the tracking ID you want to ensure that you add your own unique tracking ID from Google Analytics – It will look something like this UA-12341234-1.
Finally, we want the Track Type to be an event.
3. Configure the Event that will fire using this Tag.
Setup your event in the same way we show in the example. Basically what we’re saying is that we want to generate a GA event with the event Category of “telephone”, the action of “click” and we want the event to have a value of the Page URL.
The Non-Interaction Hit should be set to True so that the event does not affect our bounce rate.
One thing to note about events is that, by default, events affect the bounce rate. If a user lands on a page and an event is triggered, they should not be considered a bounce even if they don’t view any additional pages on your site. If someone engages with the page in some way, you probably don’t want to count them as a bounce any more.
4. Setup Goal
Before we setup the Goal in Google Analytics it’s important to understand that our event is firing.
Go to your site and click on one of the telephone links, then go back to Google Analytics and look in the real-time reports for events. You should see the following:
Now all you need to do is set up a Goal in Google Analytics for a custom event with the event Category of “telephone” and an Event Action of “click”.
Need Help Setting Up Google Tag Manager?
If you’ve followed this tutorial and you’re still confused, contact us today for a quote on how we can help you set up comprehensive performance tracking and reporting for your website. Your website is the backbone of any digital marketing campaign so it’s important that businesses track and report on the information that translates to your business goals.
12 Responses
Hello and thank you for your tutorial. I believe I have things correct but GTM is not allowing me to publish. It appears that it is having a issue with the “*”.
I’m gettting
Invalid RegEx Unknown Trigger Invalid regular expression: ‘ConvertEntityTask — *’.
Hi Todd,
Did you try making it “.*” instead of just “*”
I have the same error. Are you suggesting that it should be
“.* rather than just “*”? It saved OK as
“.*” but threw the error when trying to save as “*”.
Hi Nik, yes you’re correct that it should be “.*”. I checked my tutorial versus others on the web and they all say the same thing. I did test again after your comment the other day but noticed that it didn’t appear to be working on the PixelRush site, even though we now use CallRail, but is still working without issue on client sites. I wonder if it’s something to do with the new gtag analytics script update as the sites that it was working on were where I’d embedded the Google script manually as a tag (rather than using the GTM embed) which meant site was was still running on the universal ga() script.
Was this ever resolved? We’re getting the same issue
Thank you so much for this very helpful tutorial.
I’ve a couple of questions
1-When I made (The Non-Interaction Hit to True) the tag fired in debugging mode but didn’t show in the real-time events but it did when I changed it to false! what do you think?
2- I created the goal but it doesn’t show any conversions!
3- This is the last question 🙂 Can you help me measure it on google analytics using custom dimensions and metrics?
Thank you again,
Great write up. Shared with some of the newer marketing folks here and they picked it up right away. Definitely have the page bookmarked for them. Thanks!
Thanks Mike.
Thank you so much for an awesome guide I followed all your steps and its working fine at my end. However, it took me time to understand tag section I was lost at analytic code placement but manage to find it an implemented.
Awesome Abdullah, glad you had success.
Hi Byron,
Thanks for this guide and it has helped me a lot . Can you also share a guide if you have written about tracking a quote form? I really need it as I have to do it for the company’s website which I am currently working for.
Looking forward to your response
Thanks beforehand
Abdul Samie
Hi Abdul, forms can be a bit more challenging depending on how the validation works. You can either send the successful form submissions to a thank you page or you can fire GTM on successful form submission. The issue being is that many popular form plugins like Gravity Forms or Contact Form 7 use ajax / javascript for the validation which means that your event from GTM will fire regardless of whether the form is successful or not. This guide is excellent and will explain it further for you – https://www.analyticsmania.com/post/google-tag-manager-form-tracking/