Track Website Calls from Phone Number Clicks using GTM

Many a times, there would a scenario when you want to track the calls which originated from your website. One of the best scenarios where I find the use of tracking website calls based on the clicks on the phone numbers is in case of the Google call forwarding. In Google call forwarding, if you are measuring the phone call conversion but still you want to double check, in that case, this method comes very handy. So let us see-

How to Track calls from Website using Phone Number Clicks

Before we proceed further, there is a pre-requisite. And that is, there should be an Href link to the website phone number which will look something like this:

1. See if the phone number is using href tel tag for hyperlink

One of the main reasons why we want to make sure that the associated phone number has the href link associated with it is that we want to track link clicks with href which have tel: in them. In that case, we only track the phone number links.

 1. Set up a trigger to fire on all links

I am doing it purposefully so that you can also understand this. After firing trigger on all the links, we will narrow down the firing the trigger to only firing it on the tel link clicks. We will see that how.

Go to trigger -> New -> Name the trigger and click to begin the setup

2. Set up a link click trigger to fire on all the pages

Choose trigger type as “Click – Just Links”. Put the firing condition to fire on all the pages. Do not follow the Image below, it should be either of the followings:

  • Page URL contains / (For tracking all the pages) or,
  • Page URL matches .* (A better approach)

3. Set up a trigger type for all the links on all the pages3. Set up a trigger type for all the links on all the pages

 2. Create a tag to capture Click events

Once the trigger is set up, we will create a tag to capture the click events. Go to Tags -> New -> Name your tag -> Click next to begin setting up the tag.

4. Create a new tag to capture the click events

Continue setting up the tag as follows:

Select the tag type as Google Analytics and track type as Event. No need to fill in the category and other details as of now because we shall be filling them later. At the bottom, associate them with the Google analytics and the trigger and save the tag.

5. Tag to capture the click events was set up

3. Preview the data layer now

Once you have set up and saved the tag. Go into the preview mode. Open your website in the same browser in a new tab. The browser should be Chrome. Once you open and refresh your browser you will see another window docked at the bottom of the browser. Click on the phone number now and you will see the trigger firing on the link click.

Click on the latest event in the summary here on the left pane at the bottom. In my case, it is gtm.linkClick. And then click on the data layer at the top pane and you will see the data layer values.

We have to make use of this data layer to further refine our triggering and tagging.

  • In the element URL, you can see the phone number. We can use the element url to use the phone number as a label in the event.
  • We can further use the element url to fire the trigger only when element url has tel: in it that means firing the trigger only on the link clicks which are meant to be of a phone number. So, let’s do it.

6. Preview the data layer

4. Create a new Data layer variable to capture element URL

Here is another thing. Labeling the element url be more useful when you have more than one phone number on your website. You can track the engagement on both of those numbers and see which department with which number has better engagement. Anyways, let’s continue –

Click on Variables -> new under user defined variables -> Name your variable and click on begin to setup

7. Create a new data layer variable to get the Element URL

Select auto-Event variable as the variable type -> select element URL -> Full URL as the component type. Save it.

8. Element URL set up

5. Modify the Trigger & Tag now

Now that everything is done. Even we have begin to capture the element URL. Let us modify the trigger as well as the tag now to suit our needs. Open the trigger once again.

Do not get confused by the trigger name. Also, you can see two options are checked below:

  • wait for tags and,
  • Check validation

During this setup, uncheck the wait for tags checkbox as of now but check the check validation checkbox. Like in step 1, be careful with the URL condition again. (I apologize for that)

it should be either of the followings:

  • Page URL contains / (For tracking all the pages) or,
  • Page URL matches .* (A better approach)

In the next condition, select to fire the trigger when element url contains tel: in it. That means this trigger will fire only on the link where the element url or in simple terms, clicked element’s URL has tel: in its href which we discussed at the beginning. Now save the trigger.

9. Modify the trigger with condition to fire only on the telephone numbers - Mind checking the first two bxes

Similarly, modify the event tracking parameters in the tag as follows. You can see that under the label, we have given element URL data layer variable as the label. You can name category and Actions as per your choice. So, in case, there are more than one phone numbers on your website, you can capture them in the label. Now save the tag as well.

10. Modify the tags to capture phone number in event label

6. Preview it again

It’s the time to check the validation. Repeat the preview as in step 3. Similarly, click on the latest event in the summary and then click on the Tags. And now you can see the value of the variable defined in the tag including category and action which you had defined and in the label, you can see the telephone number. Great!

11. Preview for the setup


Go back to the trigger again and check the box “wait for tags” from step 5 and save it. Now, publish the tag and later, check your google analytics.

Go to Behaviour ->Top events -> Event label, you can see the number prefixed with tel: (because of the element URL).

12. Track phone clicks in analytics

If you think I can improve this article or you are facing issues, please let your thoughts in the comment below.

Have a Question? Get in Touch!

Leave a Reply

Your email address will not be published. Required fields are marked *