In this video, I'm going to show you how you
can detect a click on a phone number with the help of Google Tag Manager and send this
on to Google Analytics, Google Ads, or Facebook Ads. All and more, coming up. Hey there measuregeeks, Julian here back with
another video. Today, we want to talk about how we can detect
and register if somebody clicks on a phone number in their browser or on a mobile device
that will then open up their phone app. I'm on a Mac here so it asked me to open FaceTime. But if you would be on a mobile device, it
probably opened up your preferred phone app. Now be aware with Google Tag Manager since
it's JavaScript and installed on our webpage, we cannot detect whether somebody actually
calls the number. But the next best thing is to know if somebody
clicks on the phone number. And since this opens up the phone app, this
is actually a special link. So let's first look into how this is marked
up in the HTML. We'll go into inspect element here. And we see here our phone number. And the special thing about this phone number
is that it has the extension here in the front with the towel colon. And this actually tells the browser This is
a phone number, which can be open in the phone app. So if you have the same markup on your page,
how would you track this with the help of Google Tag Manager? Well, this is all possible with your auto
event tracking features of Google Tag Manager. If you're familiar with click tracking, this
should be easy to handle. So as you can see on this page already, I
have Google Tag Manager installed. I have a Google Analytics page view tag that
is firing on all pages. And now I want to fire some additional tags
that send data over once somebody clicks on this link. So first step is to head over to Google Tag
Manager. And we go into our variable menu here to activate
all our built in variables that we will use. Let's scroll down here to the click variables,
we want to detect the click. And we're going to activate all of these. All right, it's saving, and now they should
be all activated. And we see them here. Once you click on refresh of our preview and
debug mode, if you're not yet in the preview mode, you can click here on the Preview button. And then on our page, we get this little panel
here. And here in the variable menu, we should now
see our different variables that we have just activated. Next up, we want to deploy a click trigger. So we can actually detect if somebody clicked
on this phone number. So go over to Google Tag Manager under triggers
here, and click on new and simply call this click. We'll change this later on, and go with the
just links click trigger. Click on this. And for now, we'll just save it. And again, click on refresh. Go back to our page, reload that and now we
need to activate our click trigger to see what happens here in the menu so I'm just
going to click on the link, and cancel this all and we see a link click. So our auto event trigger listens to all the
clicks on the page and forwards this on to our tool via Google Tag Manager to register some information. What information is registered? Let's click on the fifth event and go to variables. And here we see our click variables got filled,
not all of them, but at least some. So we'll be able to base our filter on particular
this fifth click because we want to distinguish that our tag doesn't fire when somebody for
example, clicks on the blog here. This would also trigger a link click, but
we want to make sure that we only pick up our telephone clicks. So now that we have clicked on another link,
we can actually compare what is changing when the user clicks on the telephone number and
what is changing when it clicks on the blog link or on any other link. Well, the unique thing about this link click
you can see already is that the click text is this phone number to click URL is actually
what we saw in blue, the actual HF part of the link. And that is not true. When we go over here, this would totally change. So what we can do is based this of for example,
the click URL here, because this is very unique to this particular link click, and it would
actually also remain true if you click on any other telephone links that are may be
on the Contact Us page. So how would we go about configuring this
filter into our trigger? Let's head back to Google Tag Manager. And we have already our click trigger. Now we're going to refine this click trigger
to only fire on our phone numbers. So I'm going to put this into the name as
well and then we're going to look at the trigger configurations. There are two configurations that you can
check you don't have to check which is the wait for tags option. This is an option that would prevent the browser
for up to two seconds, be redirected onto the phone app. For example, in order for the tracking to
fire, that's an option that you have. Or to check validation option. This pertains to the features of JavaScript,
whereas callback once the link is actually clicked, that's something that I want to get
too deep into right now. But you can find out more about these features
in the help section right here. Once you click these options, you might you
need to put in a special condition when you want to start listening for this link clicks. And if you use this option, you might want
to to see just all pages, which would be the page path matches reg ex dot star. So I would urge you to try out these options
I will leave them unchecked for now because we actually don't need them always in our
tags only in special circumstances when they are false negatives. For now, we want to talk about the filter
options here. This trigger fires on and we don't want to
fire on all link clicks. We only want to fire on some links And here
we can put our condition in and choose our condition we have talked about before, which
was the click URL contains. And then we can just put in a part of the
URL, which was this little bit that comes before the phone number. So again, we're just looking into our click
variables here. And finding what makes it unique in our case
would be the click URL. And we choose as a unique point here, the
tell colon to be included. And every time this is in the click URL, we
fire our tag. So with that being configured, let's save
this. And now we have the trigger configured, we
won't be able to see anything in the preview and debug mode. And that's because we don't have the trigger
it's connected to a tag. So let's do this. First, go over to our tags. And we already have our page view tag that finds on all pages. But now let's go ahead and build an event
tag for Google Analytics which fires on our phone number clicks. As a tech configuration, we choose our Google
Analytics Universal Analytics and go with an event type right here. And we're going to type in a category action
label in our case, it would be a click to our phone number. And maybe we also want to know which page
this has happened on. So which was a variable here, that is our
page path. You could change these values around, just
make them unique to be able to recognize them later on in your reporting. Then we need to choose where we want to send
this all. I have already a variable prepared with our
tracking ID right here. If you don't have that, you can set this up
yourself, or choose to enable the override settings and put your tracking ID in here. But since we have this already in a Google
Analytics ID, this should do the trick. Now we connect this all with our trigger. Save this, refresh our preview and debug mode. Go back to our page, refresh that. And let's try this all out. I'm going to click on the phone number. And we see, we had link click, we have open FaceTime. No, we don't want to do this. But on the Facebook on the fifth link click,
we have now our event phone number clicks, to this has been sent over to Google Analytics
should be able to see this already in our real time reporting. So I'm going to go over here to real time
reporting on the overview. We see we had a page here, but we also have
an event. Yes, we have here our event, click phone number. And with our label, or label here is just
a slash because it's happened on the homepage. So again, let's try this out. Let's go over, for example to this page. So I'm going to completely different page
I'm going to click this button again, and we have our phone number click that happened
and Analytics. We now see second phone number click on our
event label With a completely different URL, so this is also dynamic. The only thing that's left to do is to also
check the negative so that it doesn't fire when you don't want it to fire. So for example, if you have a blog here, I'm
going to click on the blog with the command depressed, opens up a new tab, we have a link
click, but nothing actually fires on this click itself. So now everything is really set up to datacenter. Your tracking because you have the right trigger,
and we'll find already an event to Google Analytics. What if you wanted to find an event to Google
ads? Well, you can just connected with a new tag,
we go over to tags, and click your new This is gonna be all Google Ads tag. We're gonna do custom conversion tracking
for our phone numbers. And as a tool, which was Google Ads conversion
tracking, then you need to go into your settings of your ads account. And under Tools, measurement, you should find
your conversions here. Already in here. You can create a new conversion here. We're going to go with a website conversion,
this is going to be more like lead. So I'm going to choose lead, give this name,
which is the same value every time. In our case, just go with one euro, that's
fine. Alternatively, you could also use no value. If this is not something you want to choose,
we want to count every interaction, should leave this unchecked, and just create and
continue. So we'll go over to the Google Tag Match option
here, where we get our conversion ID and our conversion label. This is something we can transfer over to
Google Tag Manager and the conversion ID field. And let's take the label over as well. No dynamic conversion value, no order ID. And we just connect us again to our already
set up click trigger. Again, let's save this and try this out. Click on the phone number and we now should
see that Google Ads conversion tracking files as well. This by the way, within Google ads will only
be counted when there was a prior ad click within the Google Ads system. So don't worry, that it fires every time it
will only be counted if the user actually clicked on an ad before it. Now on to our other tool. Let's go with Facebook ads. So if you're a new ad manager, you can go
over to your pixels. And then you can set up a new event here by
installing a new pixel, I also go with the manually adding this code. So here we get the base code. This is something you normally would put into
a separate tag. But for now, we're just going to register
this one event. So I'm going to give this all a name. This is Facebook ads, again for an event. And this is phone call tracking, will go with
custom HTML this time because there's no text template into our Facebook quote here. We don't need this part on here as it's a
no script tag. We don't want to find a page. On this click but a custom event So we'll
go over to the pixel again. And then the second step, we should be able
to manually add our event code here. And we get different standard events. And I'm just going to go with, well today
have a lead. Let's just go with contact here. And here we go, we get the track commands. I'm going to copy that, and put this into
Tag Manager as well. We don't need this part. And this part, it looks good. Let's attach our trigger again and save this
all refresh our preview in debug mode. And we can actually try this out and this
new test event mode. So let's open our website, and this new test
event mode. Google Tag Manager opens and we click on the
phone number. And now we see our Facebook ads fires as well. And our facebook pixel in our test mode event,
we see a recent activity on our contact event that just find it. So this also seems to be working just fine. Now you can add your heart's content, install
more tools that would actually get us information about the phone number click if it's necessary. I just wanted to show the biggest ones here. And in the end, if you are happy with your
implementation, don't forget, you need to actually submit this as a version. So it goes live to your users. Because right now, we have just implemented
this on our browser. And it's not yet live, gives this all a name
and then you may publish this to all your users, and it goes live. So this is how you can install phone number
tracking with the help of Google Tag Manager. Hey, it's me again. Did you enjoy this video? Let me know in the comments down below if
you liked it, if you don't like it, or if you have more questions. And if you haven't yet, then consider subscribing
right over there because we bring you new videos just like this one every week. Now, my name is Julian. See you on the next one.