How to use Google Tag Manager to Track Phone Number Clicks

Categories Business

GTM Featured Image

Working in digital marketing, you quickly find out the importance of tracking.

Whether it’s tracking visits to your site, conversions on a landing page or phone calls from your website number – you’re going to need to track it.

Google Analytics is a great tool for doing this. It allows you to see how much traffic your site is getting, where the traffic is coming from, how long visitors stay on your site and much, much more.

In fact, the more time you spend on Analytics, the more you realise just how powerful it is!

Tracking application form submissions is as simple as setting up a goal within the admin section.

One element that isn’t as straight-forward to track is phone calls.

Say for example you have a branch network and each branch has their own contact number. These numbers are not only displayed on your website, but they’re on all offline assets and marketing collateral too.

So at the end of the month, your call tracking software is telling you that you received 200 phone calls.

Great, but how do you know how many of those came from your website?

This is where Google Tag Manager (GTM) comes into play.

What is Google Tag Manager?

Google Tag Manager is one of Google’s newer tools. It essentially allows you to host, update and deploy all website tags from one place.

See, with so many different tools available these days, you can quickly find yourself bloating your codebase with huge amounts of integration scripts and tracking codes.

Not only can this become unorganised and tough to manage, but it can affect site performance and load speed in the process.

Hosting all website tags in one place makes them extremely easy to manage, update and deploy when required.

Using GTM to track phone calls

So, you’ve set up Click-to-call using the <a href=tel> HTML tag and you’ve implemented Tag Manager on your site – perfect!

Next you need to navigate to your GTM Workspace and click Variables.

Under Built-in variables click configure. This will activate a right sidebar with a series of tickboxes.

GTM Variables

Scroll down to the Clicks subheading and tick all of the boxes.

Creating your trigger

Your next step is to create your trigger.

A trigger is an integral part of the tag creating process. Your trigger essentially dictates whether the tag fires or not.

For example, if you were to host your Google Analytics tag on GTM, you would want to set up a trigger that fires on all page visits. This is because you want to track all page visits on Analytics.

As we only want to track clicks on phone numbers, we want a trigger that only fires when this happens.

Now that you’ve activated the required variables, you need to create your trigger

On the GTM Workspace, navigate to triggers and click new. This will activate the right sidebar once again.

GTM Create New Trigger

Firstly, you’ll need to title the tag appropriately. To start with, we’re going to name this ‘Generic click trigger’ – we will change this in due course.

On the trigger configuration, choose ‘Just Links’. Make sure both the ‘Wait for tags’ and the ‘Check Validation’ tick boxes are ticked. The max wait time can be left as 2000 milliseconds.

As this is a generic click trigger, you’ll need to enable this trigger on all pages. So choose ‘Page Path’, ‘matches Regex’ and then type .* in the textbox. Here’s what it should look like:

GTM Trigger Path

Finally, you’ll want the trigger to fire on ‘All Clicks’.

Your trigger configuration should look like this:

GTM Trigger Configuration

Save the Generic Click Trigger and return to the GTM workspace.

Test your trigger

Next, you need to test that your trigger is firing correctly.

To do this, simply click preview in the top right-hand corner. You’ll be presented with the following message:

GTM Workspace Preview

Now you’ll need to navigate to your website. You should notice that the GTM debug taskbar appears along the bottom of the site (this may take a few seconds to appear first time):

GTM Debug Taskbar

With the debugger active, you can now test your generic click trigger. To do this, navigate to the page which contains your click-to-call phone number.

Now, you’ll want to click the link but not navigate away from the current page. This will allow you to monitor what happens on the GTM debugger when you cick the link.

To do this, simply hold CTRL whilst you click (or CMD and click on Mac). This will open the destination is a new tab.

You should notice that a ‘gtm.linkClick is registered on the debugger:

GTM Link Click

Click on the gtm.linkClick on the left sidebar and choose variables from the top menu.

You should be presented with a long list of variables which probably looks a bit confusing! This is simply all of the variables the we previously ticked on the GTM workspace.

Remember, we want to be able to track clicks on <a href=tel> links. Therefore, when we click a CTC phone number, we want the URL that we’re clicking to contain “tel:”.

On the variables list, scroll down to Click URL. You should notice that in the Values column it says ‘tel:’ followed by the phone number you’re clicking on:

GTM Click URL

It is the start of the value (the ‘tel:’ part that is important). This is important as it allows us to distinguish phone call clicks from all other link clicks on the website.

You can test this theory by clicking any other link on the website (holding down either CTRL or CMD). When you click on a regular link, you should notice that the Page URL value is simply the URL of the page you’re clicking on and doesn’t contain tel: at the start.

Turning your Generic Click Trigger into a CTC trigger

Now that you’ve confirmed which variables you’ll use to distinguish click-to-call events, it’s time to create the trigger.

Instead of creating a brand new trigger, we can simply edit our generic trigger.

Firstly, I’d recommend changing the title to something more specific. For this tutorial, I’ve gone for ‘Telephone Click Trigger’

When configuring the trigger, the only thing we need to change is the point at which it fires.

Previously, our generic trigger fired on all link clicks. For the CTC trigger, we only want it to fire on telephone calls.

To ensure this happens, we need to change the configuration to “Some Link Clicks”.

We then need to stipulate that the trigger only fires when the ‘Click URL’ element contains ‘tel:’. Your trigger configuration should look like this:

GTM Telephone Click Trigger

Save the trigger, return to the GTM workspace.

Creating your tag

Now that we’ve created our trigger, we need to create a Tag.

To do this, navigate to Tags on the left sidebar and click ‘new’.

Name the tag something relevant like ‘Google Analytics – Event – Phone Clicks’

In the tag configuration, under tag type, choose Universal Google Analytics. For track type, choose Event – this should enable a series of Event Tracking Parameters including Category, Action, Label and Value – you need to complete these fields with the following:

GTM Tag Creation

This part essentially dictates how the event will appear when it is reported in Google Analytics.

Under Triggering, you simply need to choose the ‘Telephone Click Trigger’ that you’ve just created.

Click save and return to the GTM Workspace.

Testing your tag

Now that we’ve created the tag and linked it to our telephone click trigger, we need to test that it fires correctly.

To do this, simply refresh the preview mode, return to your website and refresh that too.

GTM Refresh Preview

Hold down CTRL (CMD on mac) and click the contact number link.

Again, this should register a gtm.linkClick within the GTM preview panel.

Click the gtm.linkClick. You should see that your Google Analytics – Event – Phone Clicks tag fires on that event.

GTM Event Tag Firing

Equally, when you click a link that’s not a contact telephone number, the tag should not fire. This is how you know that your tag and trigger are configured correctly.

As a final test, we now need to go to Google Analytics and confirm that the event is reporting correctly.

So navigate to your Analytics platform and click Real Time > Events on the left sidebar.

Google Analytics Real Time Events

You should see that in the last 30 minutes, an Event has been reported that looks something like this:

GA Real Time Event Report

If you click on the link in the Event Category, you will then be able to see the Event Label.

If you remember, we set the Event Label dynamically as the page path. This means that Analytics will tell us which page the user was on when the click took place.

This is especially helpful if you phone numbers on multiple different pages (or in the header or footer).

Providing this is reporting correctly in analytics, you can go ahead and publish the tag on GTM.

Publishing your tags

To publish your tags, simply return to your GTM Workspace and Leave Preview Mode.

Click Submit on the top menu. Name the version appropriately, I went for something like ‘V1.0 – CTC Tracking’.

Hit Publish to submit your changes – your Click-To-Call tracking is now live!

I hope this guide has helped you. If it has, please feel free to share it using the social media buttons on the left.

If you have any questions or issues, please leave a comment in the section underneath.

Leave a Reply

Your email address will not be published.