How to Track Phone Number Clicks with Google Tag Manager


Phone Number Tracking can be done with Google Tag Manager by firing an Event to Google Analytics every time someone clicks the phone number text on the site, which then opens up the phone app notification.

In this video, we are going to use GTM’s Auto-Event Tracking capabilities to build a Click Trigger, which transfers our data to Google Analytics.

ūüĒó Links:

More Click Tracking with GTM:

FREE Google Tag Manager Beginners Course

FREE Google Analytics Beginners Course


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.

How to Install Google Analytics on WordPress – [Complete Tutorial]

Adding Google Analytics to your WordPress site can help you track your website visitors. In this video, I will show you these 3 methods on how you can install GA to your WordPress site so you can choose which one to implement.

1. Use of Plugins
2. Install and hard code in the theme file
3. GTM deployment


GTM for Beginners series:


Google Analytics



In this video, I’m going to show you the best¬†method on how to install Google Analytics on your WordPress website.¬†All and more coming up.

Hey, there measuregeeks! Julian here back with another video teaching you the data-driven way of digital marketing. Now, today we want to talk about how to install Google Analytics on a WordPress website. And as always, there’s not just one way of doing things. So today, I’m going to show you actually three ways on how to install Google Analytics on to your WordPress website. And later on, you can pick which one suits you best. I will also give you my recommendation at the end of this video. Now, we’ve got lots to cover so let’s dive in.

All right, welcome to our demo software we want to install Google Analytics on. Now, in order to do this, we need to have two things in place already. First of all, we need to have access to the admin area which we can reach under our domain name slash WP admin login and now be able to install Google Analytics on your website. Be sure to have access to the back end. Second part would be to have an actual tracking ID. And this is what you can get at login with your Google account, and then navigate to the account that you want to install. If you don’t have an account set up, you will be greeted with setting up a new account. Let’s quickly go through this. First of all, we want to track a website. Let’s choose an account name. Normally, you would choose your company name, then you can give your web property or the web tracking code a name. So for example, for us, it would be our demo shop. And then you enter your website URL.

In our case would be right here. Now, be sure to not have the HTTP part up here at the beginning. You can choose if you’re on HTTP or SSL in this drop-down menu. And then you can choose your industry and also your reporting timezone. Now, this is very important because you want to ensure that the timezone matches up with the timezone on your website to be able to compare data later. So make sure that this is set correctly. And you can choose if you want to take part in some more data options that Google Analytics provides. I’ll just leave them tick for now. And we can now click on Get our tracking ID. We need to agree to the data processing terms. This might differ from where you are located at. And I’ll accept this. And now we should get our tracking code. We jump right into the section. Now if you already have an account set up, you can simply go here to the admin section. And then on the property section, you find the tracking info that you can open up and go to the tracking code.

So you get to the same place here. And here’s where we get our tracking ID that we will utilize to install Google Analytics on our website. Let’s get to installing it. And I’m going to show you three methods here. The first method is through a plugin. So we’ll go down here to our plugins section and add a new plugin. And we simply type in Google Analytics. There are different plugins out there that will help you to install Google Analytics or choose the most popular option which is the Google analytics dashboard plugin for WordPress by monster insights. So let’s install this and activated and will put us in this setup screen. And we simply follow along with our Setup Manager here will connect monster insights to our Google Analytics. It will authenticate us to Google, we allow the settings and then we can choose our account. In our case, we had our tracking ID already available here, just going to copy this. And we’ll find here our view that we want to connect. And we will complete the connection. We can choose different tracking options. I will leave them untouched for now. But this is really about the customization of your tracking code. And that should do it we exit our wizard. And we should have now Google Analytics installed as easy as that. How can we verify that this is actually working?

Well, one is an extension by Google that you can install to your Chrome browser which is the Google Tag assistant. And we see here that Google Analytics is installed, but there is no HTTP response. And this is because Google Analytics is actually blocked for people who are admins and logged in to WordPress at the moment. So let’s open up a private browsing mode here. And I’m just going to navigate to my page. And now we are not logged in. And we can see here, Google Analytics is now deployed. Now depending on if this green or blue, this doesn’t really matter. But it seems like Google Analytics has been deployed correctly. We can also test this by going into our Google Analytics here. And here we see the status. And what we can do is test our implementation by going into the real-time traffic reports through this link. And here you can see that a page view was just generated. So this means that the user that is right now on the website which is us has generated a page view. So if we would go to the next page here should have another page view enter the picture. So Google Analytics is correctly installed. And this is our first method of how we can install Google Analytics via a plugin. I’d recommend this for everyone who doesn’t want to get technical and install Google Analytics in a very easy way. But the downsides might be that you have to install an additional plugin. This can potentially bog down your WordPress installation and slow down your page. So I want to show you another method of how you can install Google Analytics on your website. And this is through the installation in the theme files directly. So let’s head back into our WordPress back end. And I’m going to deactivate our plugin.

And now let’s go ahead and install Google Analytics again through the theme files. For that will go over to appearance, then theme editor. Now as it says here, it’s recommended that you have a child theme already set up that will let you install these codes into your child theme so that don’t get overwritten next time your theme updates. So definitely have a child theme set up first, then we can go ahead and proceed here. Click on I understand, select your child theme. And then find the header.php. Now, this needs to be set up in your child theme in order to edit this. So we’re going to click on it. And now we have access to the theme that governs our website, and especially the header of that theme. Now, we go back to Google Analytics and click back into our tracking information to get our tracking code. And here we have the global site tag, we can just simply copy. And it says here that we should install this in the head section. So with our theme open right here, we can add our information.

And I’d suggest to put this right under the meta tags right here. Just paste this in. The earlier the Google Analytics code will fire, the more likely it is to send data of so even if the user navigates on before the site has ended loading, you’ll be able to capture information. So now that we have this setup, let’s update our file and head back to our page. Now, we should see in our tag assistant, the global site tag is installed and Google Analytics so it’s already sending data over. Let’s look into our real-time reporting inside of Google Analytics. And here, we also see that there are page views already generated. If we go on to another page here, we should again see data coming in right here we see a new page view. So Google Analytics is installed correctly for our page. And this was also an easy method to install. If you are comfortable with copy-pasting code into your theme file if you have a child theme set up and don’t want to use a plugin to install your Google Analytics on your page. Now let’s go on to the last method that I want to show you. And this is installing Google Analytics through Google Tag Manager. Now Google Tag Manager is a tag management tool. So it manages all your tracking in one central place. And this is a Google Tag Manager container. To get started with Google Tag Manager, head over to and create a new account, you can follow the steps as we’ve done before in our Google Analytics set up. So we had your company here, and then your website.

You’re going to go with web, and create this and then we’re entering our Google Tag Manager container. Now the first thing that we need to do, we also need to install a container snippet onto our page into our theme files just like we did before. So let’s get go ahead and follow again the steps that we just did earlier, I’m going to copy the first code that needs to be in the head section. We’re going to go into to our theme settings and our theme editor, choose our child theme here, go into our theme header PHP. And this time, I’m going to get rid of our global site tag that we have installed right here. Instead, paste our code of Google Tag Manager. Then there is a second code that we need to place beneath the opening body tag. So we’re going to look for the body where it starts right here. And right underneath going to post our Google Tag Manager, no script tag. Let’s update this file.

Now we can head back to our page, reload that. And in our tagging system, we see that we have Google Tag Manager now installed. But Google Analytics is actually not yet part of this implementation. We will need to deploy Google Analytics through Google Tag Manager. How do you do this? Well, in Google Tag Manager now, you have access to the website itself through that central snippet that we’ve installed on all the pages. We just need to deploy the tracking tool that we want to install through this Management Console. And you do this by going into Google Tag Manager and clicking on new tag and give this all a name. So we’ll be able to recognize this later. And then when we click on tag configurations, we can see all the different tools that you can install through Google Tag Manager onto your page. Now, we are interested in Google Analytics, which is right on the top right here. So I’m going to click on that. And we want to set over a page view, Now, we need to specify the account which we can do by setting up a new Google Analytics settings variable.

Here, we need to implement our tracking ID. Go over to Google Analytics, go into our tracking information and copy the tracking ID right here. Go back to Google Tag Manager, paste it in here. I’ll also take this as a name here. So I will be able to recognize this later. Let’s save this. And this is really what we would need, we just need to define a trigger right here. And there’s already one available which is the all pages trigger. So it will be deployed on all the pages. Let me fix this typo up here. And we are good to go. Let’s save this. And now we have implemented one tag into our tag manager. We can try this all out by going into the preview mode. This will put our browser into a special mode. So we will be able on our page when we reload our page to see a debug console down here which will show us which tag have fired on our page. Very practical to see if your tracking is actually deployed. And he will see our Google Analytics is deployed, we can also cross check this in our tag assistant. Here we go. The tag assistant shows that Google Analytics is deployed. And also in our real-time reporting. There’s one user right now. And here we go our page was sent and received by Google Analytics.

Now be aware once we’re in the preview mode, this is actually only deployed for you on your browser. This is not yet live on your website. In order to push this live to the website, we will need to submit a version. This is what this big Submit button is for click on here and we can give our version a name. So you’ll be able to see all the changes we have done to our container later on. Let’s publish this and it’s should be now live on our website. So if I go back here and leave the preview mode, reload our page, you now see Google Analytics is installed and Google Tag Manager. Now, don’t worry if those are not green. This just means that it’s a nonstandard implementation since you have done it through Google Tag Manager. But your data is still safely sent and received by Google Analytics.

Now you have seen that we have gone through quite some steps in order to set this up with Google Tag Manager. The big advantage to this setup is that you will be more flexible once you want to do customization and really get into advanced tracking techniques. Because not only can you deploy easily Google Analytics, but also your facebook pixel, Google Ads tracking, conversion tracking, or even set up certain triggers that trigger on interactions such as a button click or when something comes into view, or form Submit. So very versatile when it comes to expanding your tracking beyond the scope of just deploying a tracking code like Google Analytics onto your page. It also decouples what you set up in your WordPress installation. So if you ever wonder what tracking code is firing where you would be able to look this up in your central tracking tool which is in this case, Google Tag Manager. So for me, setting up Google Analytics through Google Tag Manager is the best way to set up Google Analytics as it brings a lot of advantages of expanding our tracking later on.

All right, so there you have it. This is how you can install Google Analytics onto your WordPress website. I showed you three ways. One is the plugin. One is to install and hard code, essentially, the code onto your theme file, and then the deployment through Google Tag Manager. Now, I made it already clear that I prefer the more hard way of doing things, which is the deployment through Google Tag Manager just because it makes me more flexible later on. If I want to install the Facebook pixel or Google Ads tracking later on, then I’d be able to do this seamlessly through Google Tag Manager. There are a lot of advantages. And if you want to find out more about Google Tag Manager, we actually have a Google Tag Manager for beginners course up right here that you can view and learn more about now. I’d love to hear from you. Which implementation method did you pick? Or will you change your implementation method right now onto your WordPress website? Let me know in the comments down below. And as always, if you liked this video, why not give us a thumbs up and also subscribe to our channel right over there because we bring you new videos just like this one every week. Now, my name is Julian till next time.

Enhanced Ecommerce Promotion Tracking (Part 2)

Google Analytics Enhanced Ecommerce Tracking can be installed with Google Tag Manager. In our last part (link below) we discovered how to track the view of a Promotion with the Element Visibility Trigger. In this part, we are going to track the click of the Promotion.

Part 1 –

? Links:

Enhanced eCommerce tracking demo shop:

DataLayer Documentation:

Container Download:

Welcome back. In this video, we’re going to take a look at how we can track our enhanced eCommerce promo clicks with the help of Google Tag Manager and our custom JavaScript variable. So like in the last tutorial, we already had a closer look at how we can set up such a dataLayer inside of a custom JavaScript variable. Now, we want to also track our actual clicks. Now, these enhanced eCommerce tracking dataLayers was built the same. But for our dataLayer here we have a promo click as the action. And this is something we would need to change in our tracking deployment for promo clicks. So let’s take a look at the specification here. Down below, we here have the measuring promotion clicks. And we want to do the same as with the other one. Now, I’m going to just copy the whole thing here, the whole dataLayer push. Okay, so this would be this year, going to copy this and going to go over to Google Tag Manager and build an enhanced eCommerce tracking promo view. I’m just going to copy this and going to call this enhance promo click. Now, we had our dataLayer before, I’m just going to replace this.

So here we have our dataLayer. As I said, we are not really pushing anything into the data, we just need the eCommerce object. So we can get rid of anything right here, dataLayer push and back here. Now, this is built, especially for a tracking scenario where you would forward the user on and you want to ensure that the data is actually transferred. This is done within the event callback, we can get rid of this portion as it is deployed through a variable here. So I’m going to get rid of these data points as well. And this should give us our enhanced eCommerce tracking object except for the event up here. This one is also something we wouldn’t need as we are not deploying a dataLayer. We want to simply have our eCommerce data object. Now, you see this promo object ID, project object name, and so on. This actually needs to refer to the same data that it was actually viewed. So we need to have the same data in here as we had from the one that is viewed. So I’m going to just save this, for now, go over to our view here and copy out our promotions view here. All right, let’s go over to the click data and type that in as we had before. So now we are clicking on the same data as via viewing. And if you know about enhanced eCommerce tracking, you know that you need to keep data consistent. Otherwise, the data reports inside of analytics won’t be filled correctly. So we have this now prepared. And again, we need to go through and build a tag for this. In our case, this can also be copied. So let’s copy our event here. This time, it will be a promo click event. Also going to change the event tracking parameters, this will be a promo click. And we obviously want it to pick up different data, not the view data, but the click data. So this is now specified as well. And we want to change our trigger out. So let’s click here and get rid of our visibility trigger. And in our case, it would be simply a click trigger. So let’s go here for our clicks. And I’m going to go with the all elements trigger. And let’s keep it generic for now, I’m going to build a generic click trigger.

Let’s save this. Before we move on, I need to configure my built-in variables. So we actually have our click element, click ID, and so on enabled. Let’s refresh our previous debug mode. Go back to our page and see how our variables get filled. I’m going to click on the ad. Now, this didn’t do anything. Let’s refresh here again. Oh, that’s why we had a semicolon error in our class some JavaScript variable. Let me just figure out what this is all about. It’s probably simply because we have some white space here. Let’s get rid of this and save this, refresh. And this time it does it. Okay refresh our page and I’m going to click on this with the command keypress. We have our GTM click our EE promo click already fires, that’s fine, but we want to restrict it to only fire on our ad. So we’re going to look into our triggers here, all variables and we see here our click classes get filled. And we have some information here about the click classes. Let’s go with the WP image 71. So if that’s inside of our variables filled, then we want to fire this so I’m going to turn our generic click trigger into a specific one on our ad click and I’m going to install a filter and that filter will be on the click classes if it contains WP image 71. Let’s save this. And again, try this all out.

Press this button and we see our click has fired. If I click anywhere else, it also generated GTM click but nothing fires. So this works fine. And we have now deployed our data. Let’s see if it is received by Google Analytics. Let’s go back to the real-time reporting on the events we see that there are some new events here. We had our promo click, three times promo click and that data should then also have attached our enhanced eCommerce tracking data. We can actually check inside of our let’s go on to inspect here this will open up our developer tools and we have under the console. Let’s reload our page actually. Here is our Google Analytics information. The page view has fired now also our page promo view should have fired and now click with the command keypress. Yes, we get our data in here as well the creative and so on. Everything that we have filled in. This time it’s a promo click so that data was transferred over to Google Analytics. We already saw this here in the enhance eCommerce click was just registered. Now let’s look into our conversions under eCommerce reports, marketing, and internal promotions and go to the right date.

And we see our internal promo clicks were also registered here. So this data was transferred correctly.
Now, this is it with this little tutorial. Just to recap, we have put in the right dataLayers into an enhanced eCommerce tracking variable. And this is a custom JavaScript variable that just returned our eCommerce object with the right data. And then we have triggered an event tag through Google Analytics that transport that data over to Google Analytics correctly. So it doesn’t use the dataLayer. It doesn’t read from the database, it reads from our custom JavaScript variable. And this is how you can fill these reports without actually deploying a dataLayer. But doing everything through Google Tag Manager, which is quite beneficial if you have only one promotion running on your page just like this.

All right, so there you have it. This was it with our little tutorial here on promotion tracking with enhanced eCommerce tracking features. Now, it’s always astounding to me that you can utilize all the built-in mechanisms of Google Tag Manager such as the element visibility trigger and then also the click trigger to make this deployment happen. I’d love to hear from you if you run into any problems or if you want to use this tracking deployment. If this helps you please leave us a comment down below. I always love to hear from you guys. And if you liked this video, then give us a thumbs up and also subscribe to this channel if you haven’t yet because we bring you new videos just like this one every week. Now, my name is Julian, til next time.

How to Track the Initial Traffic Source with Google Tag Manager

Google Analytics by default attributes the last known source to the User. But what if you wanted to know which source initially led to a conversion?

In this video, Julius from AnalyticsMania will show us how we can track the initial source of traffic, save it to a cookie and port it into a custom Dimension.



Script used:


In this video, Julius is going to show you how you can track the initial source from where your user came from in Google Analytics. All and more, coming up.

Hey there and welcome back to another video of teaching you the data-driven way of digital marketing. My name is Julian. But today we have a guest and he’s back on the channel again. Julius from Analytics Mania has joined us to show us a new tracking technique. Now, you probably know in Google Analytics, how to view your source data and where your user that came from. Well, that’s oftentimes just half the truth because it’s heavily based on sessions, which means that you really just know where your user that came from last but not initially. If you wanted to track that you would need to explicitly track it in Google Tag Manager, for example. Now today, Julius is going to show us how we can track that information in Google Tag Manager, and then forward this on to Google Analytics. So we have it available as a custom dimension. Now we’ve got lots to cover. So Julius, take it away.

Thanks, Julian. One of many awesome Google Analytics features is acquisition reports. Thanks to this information, you’re able to see where your users are coming from, whether it’s a Google search, email, Facebook traffic, or any other sources. Every time a new visitor session starts, Google Analytics checks where that visitor is coming from. But what if you want to track the very first traffic source that drove the visitor to your website? Luckily, that is possible with the help of Google Tag Manager and some custom JavaScript. Before we continue, I would like to mention that custom JavaScript that I will use during this video was based on the UTMZ cookie replicator created by the team of Lunametrics. But keep in mind that the code that I will use is a bit modified compared to the Lunametrics code. All right, so let’s start. Here I have a Google Tag Manager container that has two items in it, the Google Analytics page view tag and Google Analytics settings variable. Now, the first thing that we need to do is to get a JavaScript code that reads the UTM parameters, the referral data, and all other information related to the traffic source of the visitor. And that information is then stored in a first party cookie that we will use in our Google Analytics tag. And here is the script itself, you will find the link to this code in the description of this video. So just let’s copy it and go to Google Tag Manager tags,

create new tag, tag configuration, choose custom HTML and paste the code. Let’s name the tag, CHTML, which stands for Custom HTML. And let’s call it Set that initial traffic source.Let’s fire it o n all pages, at least for now.¬†And let’s take a look at how it works in action. Hit the Preview button and go to the website that you are currently working on. Click Refresh. And here’s our preview and debug mode. Now, we need to check whether the cookie that contains the initial traffic source information was actually created. If you are on a Chrome browser, collect this three dots in the top right corner and choose more tools, developer tools. Go to application, and under the storage section, choose cookies and click the domain that you are currently working on. Keep looking for a cookie that this called initial traffic source, here it is. And as you can see, the UTM campaign source is direct, UTM campaign medium is none, and UTM campaign name is not set. That is because I landed on this page just by entering the address in the address bar. Now let’s see how our custom JavaScript code works under the circumstances. But before we do any test with that code, first, you need to delete the initial traffic source cookie. So let’s do that. And now let’s imagine that I want to find on Google search Analytics Mania. And if I click this link, let’s see what happens.¬†As we can see our custom HTML tag that says the cookie has fired successfully. Now let’s go to our cookie list and see what happens there. Our initial traffic source this time is Google organic and campaign name and the keyword are not set. So as you can see, the custom JavaScript works as expected. And now let’s proceed to another step. By the way, it’s worth mentioning that when a visitor lands on a page, the Google Tag Manager with that custom JavaScript checks whether the initial traffic source cookie exists on a browser. If it doesn’t exist, then the cookie is created. If it does exist, then the script does nothing. So this means that if the initial traffic source cookie exists in a browser, Google Tag Manager will not override it and keep its original data. The next step that we need to do is to create a variable that reads the initial traffic source cookie. Why because by default, Google Tag Manager does not recognize this information. Because for example, if we click on window audit event and go to variables, you will not find any information related to the initial traffic source. So in order to read that cookie and turn it into a variable in Google Tag Manager, we need to go to Google Tag Manager, click variables, and create a new user-defined variable.¬†Choose the first party cookie type and enter the initial traffic source.¬†That’s called the cookie.¬†Click Save. And let’s test whether it’s working properly. So refresh the preview and debug mode. Always refresh the preview and debug mode first, and then go to the website and refresh the page.¬†Choose any event you want. For example, page view. And let’s click variables. What you’ll see is that the cookie, the variable actually returns the value of the cookie. Now what we want to do is to push this data to Google Analytics as a custom dimension. First, let’s go to Google Analytics and create a custom dimension. Go to admin, choose the property where you want to create a custom dimension, choose Custom definitions, custom dimensions, and create a new custom dimension.¬†That is called initial¬†traffic source, choose the scope of the user and create a new dimension. What we see here is that the index of our dimension is one that’s copied. And let’s go to Google Tag Manager and update our Google Analytics settings variable.

Let’s expand the settings of our variable, click More Settings, then choose Custom Dimensions and enter the custom dimension.¬†And we want to pass to the custom dimension number one, the value of our cookie variable. So click the button right here, and choose the cookie initial traffic source variable. Click Save.

Now one last thing that we need to do is we need to make sure that the cookie is set first before the Google Analytics tag fires. Therefore, what we need to do is we need to go to the tags section and click on our page view tag¬†and go to Advanced settings and click the tag sequencing. We want our cookies setting tag that custom HTML tag with custom JavaScript, we want it to fire before that Google Analytics page view tag fires.¬†So here’s how it works. When the page loads, this custom HTML tag will fire first. And after that tag has fired, then Google Analytics page view tag will follow. And it will use the cookie that was created by this custom HTML tag, click Save. You don’t need to set the custom HTML tag and tax sequencing on all Google Analytics tags, it’s completely enough to set it on only Google Analytics page with that because when the page loads, then this tag will fire first, it will set the initial traffic source cookie. If that cookie does not exist yet, then the page view tag will fire. Since we configure the custom HTML tag to fire every time before the Google Analytics page view tag, we can now remove the all pages triggered from that custom HTML tag. So let’s do that. Let’s close this one, go here¬†and remove the all pages trigger. This tag will not have any triggers set but it will fire anyway. Because we have included that this tag and the tag sequencing. And that is displayed right here. So click Save. Last but not least, and it’s very important, we need to test whether this implementation works properly. First of all, let’s refresh our preview in debug mode, go to the page that we are currently working on. And let’s delete those cookies. Because we want to test everything from A to Z. So go to developer tools. And let’s remove the cookie that is initial traffic source. Enabled assistant Chrome extension.¬†And finally, let’s refresh the page.

So what happened right here is that our custom HTML tag has fired successfully. Well, at least we think that it fires successfully. Now, let’s check whether it did the job correctly. Let’s go to developer tools,¬†application. And then we see that our initial traffic source has been set and the traffic sources direct and medium is none. So half of the job is completed successfully. Now, let’s go to the tag assistant Chrome extension, click on Google Analytics and see what data was passed over to Google servers. So click here. And we see that there is a tab called custom metrics. So we see that in as a custom dimension number one the value of our cookie was set. Now do not fear, it doesn’t look that nice compared to the value of our variable right here.¬†That’s because the equal sign is encoded right here. But if we check the Google Analytics reports, we will see that this strange code will be actually displayed properly as an equal sign. Let’s take a look at how the initial traffic source looks in Google Analytics reports. So head over to Google Analytics. Here, I have the acquisition reports of source and medium. And with the default GA functionality, you are able to see the last traffic source that was attributed to goals. Of course, if I had some data right here. But thanks to the initial traffic source, you’re also able to see what was the very first traffic acquisition source of those visitors. So you can do that by adding a secondary dimension and the initial, and here it is.

And here’s the data. Ignore the first line I was just playing around with that custom HTML tag. So this is the result. But as you can see, everywhere else, we see not only the last traffic source but the first one as well. So this might give you some new ideas and insights on how traffic sources are contributing to the success of the business. Now, another thing that you need to keep in mind is that this data will not appear in your GA reports right away. It is not available in real time reports, because real-time reports do not display custom dimensions. Also, this data will not appear pretty soon in your regular GA reports. For example, in my case, it takes up to several hours. But usually, I am ready to wait for up to 24 hours. So this is a really important thing to remember. So that’s it. Now we know how to track the initial traffic source of a visitor. This allows you to see the very first source from which the visitor landed on your page.

Now, before you start implementing the solution by yourself, you need to understand the caveats of this solution. First of all, it is based on cookies. So that means that if a user visits your website from another device, or the visitor just simply clears the cookies in the browser, the initial traffic source data will be lost. And when the visitor lands on the page, again, the initial traffic source will get some new value, which will probably be inaccurate. Another caveat is that if you are using cross-domain tracking, and if the visitor navigates from one website that belongs to you to another, there’s a chance that you will see the self-referral data. And unfortunately, this script does not support the referral exclusion list of your Google Analytics settings. That’s why you might see self-referrals in your Google Analytics reports. Additionally, if a person has visited your website some time ago before you implement this initial traffic source tracking solution, there’s a high chance that the value of the initial traffic source parameter will not be accurate, because the script cannot access the historical data of the visitor. However, if you want to go with a more robust solution, you should cooperate with a developer and ask that if the developer would push the initial traffic source data to the data layer. And then you would use that data in your Google Tag Manager container and push that further to Google Analytics or some other third party tools. So that’s it. I hope that you found this video useful. And if you have any questions, just post the question below the video or go to and contact me in person.

All right, so there you have it. This is how you can track the initial source of where the user came from in Google Tag Manager first of all, and then forward this on to a custom dimension in Google Analytics. Now, I’d love to hear from you. How would you use that information when once you have it in Google Analytics? If you have already built this in what insights did it give you? Please share with us in the comments down below. Now big thanks to Julius from Analytics Mania. He has a great blog that you should check out at And if you wanted to be on the channel because you want to share a cool tracking technique with us then please reach out to and maybe we’ll see you soon enough on this channel. Now, as always, if you like this video, please give us a thumbs up and also subscribe to the channel right over there. Because we bring you new videos just like this one every week. Now, my name is Julian. Til next time

Track Cookie Consent OptIns with Google Analytics

GDPR has raised the question how we could enable and disable Advertising Features in Google Analytics via Google Tag Manager – Previously there was no good way of doing this programmatically, but in this Live Stream we want to take a look at the new feature of allowAdFeature flag in the Field to Set options to turn this on/off based a cookie consent


? Learn more from Measureschool:

?Looking to kick-start your data journey? Hire us:

? Recommended Measure Books:

? Gear we used to produce this video:


In this video, I’m going to show you how you can connect your cookie consent form with the AllowAdFeatures from Google Analytics. All and more, coming up.

Welcome back to another video of teaching you the data-driven way of digital marketing.¬†My name is Julian.¬†And on this channel, we do marketing tech review, tutorials¬†and the occasional live stream. So if you want to be here live, then consider subscribing and also click that bell notification so you will be notified once we go live. Now today, I want to talk about with you about the Allow advertising features in Google Analytics and how to connect it to your cookie consent form. We’ve done a video previously on GDPR compliance with Google Analytics. And that video, I basically showed you how to turn off all the different features of Google Analytics to become GDPR compliant. You only do the base tracking that Google Analytics actually allows you to do by default. And in this video, or I got a lot of questions on how to actually turn on the advertising features of Google Analytics. That’s the demographics reports, but also building remarketing audiences by a Google Analytics programmatically. So you’ll be able when somebody clicks on a cookie consent form and says, Yes, I accept to these terms that you will be sending out that data again to Google Analytics, to double click and to Adwords. Now, this was a bit tricky previously, because Google Analytics didn’t have a programmatic flag to actually say, Okay, I want to turn this on, I want to turn this off for this user. But now they have built in a new field that we can trigger with Google Tag Manager in order to connect the form to the actual¬†advertising features. So¬†without further ado, let’s dive into this training.

First of all, what are we talking about here? When we have the ability in Google Analytics apart from the website and clickstream tracking that we have set up with the Google Analytics js code to send our data to different other services. One of the services is double click, which gathers information and then feeds it back into Google Analytics through the demographics report. So you can get data like the rough estimates of the age of the users or their interest, agenda, for example, here as well. And this is a feature that you have to turn on. The other feature that you need to specifically turn on is when you have an audience here, you can always turn that audience into a remarketing audience. So you can build a remarketing audience that then sent this over to AdWords and you can remarket to users directly from Google Analytics. Now, these are not really third services since Google is one company. But it goes out of the scope of Google Analytics. So previously, you had to turn these features on in your tracking information, you have your data collection here. And here are two features, the remarketing features, and the advertising features that you had to turn on in order for this data to be gathered. That will turn something on in your tracking code, and then send that data over to these other services and remarket the user.

Now in GDPR terms, you might want to turn these features off, because the user has consented to actually being tracked through these other services¬†and especially giving that data over to these other services. But it was all right if you actually informed the user about it, and got his explicit permission. And once you have the permission, you may want to turn these features on again. Unfortunately, that was not a programmatic way to do this in¬†Google Analytics to say to Google Analytics, okay, now the user has consented, please now collect that data. But they have now introduced a new field in the analytics JS library that will allow us to turn these on programmatically. And this is the AllowAdFeatures. And it’s a line of code that you would need to programmatically put into your tracking code. Or you can deploy this via Google Tag Manager as well. So whenever somebody has consented to¬†being tracked, you could deploy this tracking code and therefore be able to track this data in Google Analytics and build remarketing audiences.¬†So today, I want to show you how you can actually accomplish this because there were some questions on how can I connect my cookie consent form to this AllowAdFeatures. Okay, first of all, you need to have a consent form. In the basic sense, a lot of people have like a little toaster plugin or something that pops up says, Okay, here’s my cookie policy. And here’s my cookies that I set. And do you agree to this? I have installed on this page, a very simple one that you can download from And it will give you the complete code that you can just pop into a custom HTML tag, that’s what I’ve done. And this will then on every page fire and pop up on your page. Now is this fully GDPR compliant? I don’t want to vouch for this, it is definitely a form of consent, where you have to click a button before something happens. The mechanism here is really that it just wants to once you click the button sets a cookie, and then you won’t be followed around anymore. But if the user doesn’t want to get this pop up anymore, he needs to say yes, to the cookie policy. And it will follow him around. I don’t know if this is best practice. And it’s according to the law. There might be other more sophisticated platforms out there. Nonetheless, the techniques that I want to show you right now about how you can actually connect that it to Google Analytics. So if you have a different cookie consent form, just use that and see how the cookie actually gets set. Now, once I click on this Got it button, a cookie be will be set in my browser. So it can open up the developer tools, which will find up here under more tools we have the developer tools. And then I can go to the application settings, up here is the tab applications and on the left side, we’ll find our cookies down here that are set on our website. Now we have some Google Analytics cookies, but also a new cookie called cookie consent dismissed and it has the value of Yes.

So if I reload this page now, we still have that cookie, it is safe on our browser, and we don’t see our cookie consent form anymore. Now, if I delete this cookie¬†and reload the page,¬†obviously, this¬†cookie consent form will reappear. So here we have the cookie consent form. So it just checks whether it was agreed to or not. And then it will show it or not. For us, we can use that in our Google Analytics deployment. Now, again, if I click on Got it here,¬†I can click on the refresh button for the cookies. And we should see here or cookie consent dismissed is now set to Yes. Now, how¬†can I tell Google Analytics once the user has clicked on God it that he should deploy this advertising features? Well, in Google Analytics itself, you will need to first of all turn on these features. So they need to be toggled on. There’s also another way to do this in Google Tag Manager. But once you decide to turn this on, you can do that on the server side in Google Analytics directly. So you don’t have to mess with Google Tag Manager itself. By default now, all of these people who get tracked by Google Analytics will be also sent over that information. And that’s something we want to avoid. We want to only send it over when somebody has actually agreed to this. So we need to build something into the measurement side extra to this to allow this advertising features only for certain users. And let’s dive into Google Tag Manager. First of all, I have deployed here a Google Analytics page view tag pretty simple and I haven’t chosen to use the Google Analytics settings variable, you can definitely do that. And it sends us over to my account. And now we have here a field to set option. Now in this filed to set option, we can modify this to enter our AllowAdfeatures. Now, this is the name of the field and we can set it to a value, this value is either true or it’s false. Now, by default, the value is actually set to true. So the allow advertising features are sending over this data. And if we now wanted to change this programmatically based on the user input, we would obviously need to somehow have access to the cookie and then pull it into our Google Analytics field. For now, let’s save this¬†and try this out on our page. First of all, just as field and see what the console says, we have, well, let’s go back into our Google Tag Manager and actually¬†put Google Analytics or our Google Analytics tag in a certain mode. And that mode is under Advanced configurations we’ll set the use debug version to true. And that will give us some useful information into the console. We could also do this by the GA debugger extension, which I also have installed. But it’s nicer to do this on where people can actually try it out. And here, we see what data was actually sent over to Google Analytics. And we can see this tracker set AllowAdFeatures to true which is by default, anyway, set to true. So it doesn’t really make a difference. Now, the data would be sent over to Google Analytics to AdWords and to double click so we can get that information into Google Analytics. All right, now, we want to set this off from a perspective of the¬†the user if the user hasn’t yet¬†agreed to our cookie consent form. How would we do that? First of all, we would need to have access to our cookie right here. How can we get access with Google Tag Manager to our cookies? Well, there is a variable that’s built into Google Tag Manager, where we’ll just go to variables over here and click on a new variable. And as a type will choose the first party cookie. And that’s how you can get access to your cookies that are installed on your browser. And for us, we can just take our cookie name here. In our case, let’s go back and see this is the cookie name Cookie Consent dismissed. Let’s copy this and put that in here and click save. Well, I’m going to give this a name as well. So we know what it is. And¬†set Refresh.¬†Refresh our page. Let’s close this.¬†And if you go to variables now,¬†click on an event, we see that our cookie was set to Yes. So our¬†Google Tag Manager now picks up the value of the cookie and it is set to Yes, and in this case, I want to send over the AllowAdFeatures. Now, one hurdle. The next hurdle we need to take is actually that our¬†field our allow advertising features field only accepts values that are true or false. It’s a boolean value. So we can feed into this field the yes or no, we would actually intelligence furthers into a yes or into a true or false.¬†How can we do that in Google Tag Manager? There is another functionality of a variable, which is the lookup table variable. And the lookup table variable basically takes an input and rewrites that into the output that you want. In our case, we can go to the¬†a new variable, build a new¬†lookup table variable, right here, lookup table, it’s what’s called. And here’s where we take our input variable. In our case, that would be our cookie, and whatever is inputted in that cookie. So if the input is yes, we want to actually turn us into true. If the input is oops deleted, true. If the input is no, we want to turn this into false, which is not really a value because we didn’t see that in our cookie, we can’t really set this value to know no. What would be the negative case here if the user hasn’t yet¬†hasn’t yet agreed to our terms? So if we go back here, and just delete our cookie consent,¬†or our cookie and reload the page. Now, in this case, the user hasn’t yet agreed to our cookie, right on our privacy policy. And therefore, we don’t want to send that data over. And what does our input actually say, in terms of the variables that we have in here, the cookie is undefined, it’s not yet set. And therefore, we could take that undefined value and translate it into false. So let’s go over here, undefined, and set that to false.¬†Let’s rewrite this into a lookup table¬†for our cookie consent.¬†All right, let’s save this. And¬†Refresh. Refresh our page.¬†And now let’s look into our variable,¬†we have our cookie consent dismiss is undefined. And therefore our lookup table variable will be set to false.¬†What happens when we click on Got it? Well, first of¬†all, nothing happens. Because we don’t have a new event in here. If we reload the page, now that the cookie was set, we should a new value in our variables the cookie is set to Yes. So our lookup table is set to true. So now we have rewritten the inputs here into true or false. And that’s something we can now use in our Google Analytics tag. So let’s go over to tags and go to GA page view, and then click on the field to set options here. And we’ll set our value not by default to true, but to a variable that we can access here. And this is our lookup table variable. So let’s save this,¬†record refresh. And I’m gonna¬†first of all, clear the cookie again¬†for our test case.¬†Now that’s cleared I’m going to reload the page¬†and Google Analytics fires. Now, what data is actually sent over? We can see that in our developer console because we are still in this debug mode.¬†And we see that our AllowAdFeatures was turned to false we haven’t yet agreed. In every consecutive pageview, if I go around the page without clicking on the gutter button here, I will not be sending that data over to double click and I won’t be setting a remarketing pixel. So that data for this user at least because it hasn’t agreed yet is not available in analytics will not go into our audience demographics reports and also not in our remarketing list. Now once the user has clicked on Got it, every consecutive page view, so if I go to the next page, or just reload the page,¬†this will be set to true automatically. And as long as the cookie is sticking around. So if the user doesn’t go to another device,¬†or doesn’t clear his cookies, or goes into a private browsing mode, we’ll see still be able to use that user or the data will still be sent over to our advertising features, such as a double-click, and Adwords.¬†So it works as expected. And this is really how you can install this and connect your cookie consent form to this new AllowAdFeatures. Now in the end, first of all, let’s¬†get rid of our debug version True. So it doesn’t always log this to the console. And the other thing that I need to tell you if you want to deploy this is obviously to use a Google Analytics settings variable, then you only have to configure this field to set option once in your Google Analytics settings variable. And if you have any other tags, such as event tags, this obviously also needs to be set. But with the Google Analytics settings variable, you only have to¬†do it once in the variable itself, then reuse that variable inside of your Google Analytics tag. I didn’t do this year because we just have a one-page view tag and¬†obviously, if you’re done with your tracking deployment, everything works as expected. Submit this as a version and give this always a name. And publish this to all your users so it goes live.¬†All right, so there you have it. This is how you can build in your or connect your cookie consent form with the help of Google Tag Manager to the AllowAdFeatures in Google Analytics. Now, I’d love to hear from you. What precautions Have you taken when it comes to the GDPR? Do you have more complicated cookie consents form? How have you handled that previously? And if you haven’t yet, then why not consider subscribing right over there because we bring you new videos just like this one every week. Now my name is Julian,¬†the next time.

Button Click Tracking with Google Tag Manager – Everything You Should Know

Tracking Button Clicks used to take serious technical chops to pull off. If you have Google Tag Manager installed you simply need to follow a few steps and will be able to send Events to Google Analytics, Facebook and AdWords. In this video you are going to learn the 4 steps you need to follow to setup your Events correctly with Google Tag Manager

The Steps are:
1. Setup a generic Click Trigger
2. Perform the Click to see what GTM picks up
3. Inspect the variables and refine your Trigger
4. Connect your Trigger to a Tag (such as Google Analytics,
Facebook, AdWords and more….)


? Links from the video:

GTM Event-Tracking Playlist:
GTM for Beginners series:

? Learn more from Measureschool:

?Looking to kick-start your data journey? Hire us:

? Recommended Measure Books:

? Gear we used to produce this video:


In this video I’m going to show you how you can track button clicks with the help of Google Tag Manager and send an event into Google Analytics, to Facebook, or to AdWords. All and more coming up right after this.

Hey there and welcome back to another video of teaching you the data driven way of digital marketing. My name is Julian and on this channel we do marketing tech reviews, tips and tricks videos, and tutorials just like this one, so if you haven’t yet, consider subscribing to our channel and also click that notification icon so you stay up to date with what we do every week.

Now today we want to an update video on a very popular video that we did a while back here on this channel, which is about button click tracking with Google Tag Manager. Now once you watch this video you will understand how auto event tracking works with Google Tag Manager and then be able to send an event to Google Analytics, to Facebook Analytics, or even AdWords. So let’s dive in to today’s video.

But before we get started we need to actually learn a little bit of theory on how auto event triggers work within Google Tag Manager. So if you want to install event tracking with the help of Google Tag Manager, you need to be aware that Google Tag Manager can deploy an auto event trigger. And this trigger actually has two functionalities. One is the listener functionality, and the second one is the filter functionality. These combined determine whether a tag like an event tag is deployed and transfers information to Google Analytics. Let’s make this a little clearer. So let’s say you have a website where you have Google Tag Manager installed. And you deploy an auto event trigger, in this case a click trigger.

Now this click trigger will first of all listen to any kind of clicks that happen on the different elements and every time somebody clicks on any of the elements on your website, it will forward an event into the trigger and then the filter functionality will determine whether this event is the right event and then based on that turn true or false and in turn trigger your tag that transfers information to Google Analytics, could also be Facebook Analytics or AdWords. So again there are two functionalities, one is the listener functionality, and one is the filter functionality. And therefore we need to go through steps in order to ensure that both of those functionalities actually work. So in order to build effective event tracking with Google Tag Manager, we need to go through these steps.

First is to build a generic click trigger and then try out to trigger the event. If this can be listened to and we can actually pick up the right event, we can refine our trigger, turn our generic click trigger into a specific one only for our element that we actually want to track, and then connect this all to a tag. So let’s go through these steps. Back in our Demoshop we have here a website where we have Google Tag Manager installed.

Now if you don’t have Google Tag Manager installed then you can follow along this video, it will help you to do just that. And we have Google Tag Manager installed here, if we want to make sure that this is actually installed we can always look in our tag assistant for Google Chrome or go into our Google Tag Manager and actually click on the preview in debug mode which will put our browser and only our browser into a special state, which will give us the ability on our website to see what’s going on with Google Tag Manager by just reloading it and we see this little console pop up down here which will get really important in a second. Now the first step that we want to go through is to actually build a generic click trigger. For that we’ll go over to Google Tag Manager, click on the triggers, and then click on new right here. Then we give this all a name and click on the trigger configurations. Here we can choose our trigger type, what kind of event do we want to listen to. In our case it would be a click trigger and we’ll go with the all elements. You can also use just links, but to keep it more general I will go with the all elements trigger. Now here we don’t have to do anything anymore.

We want to listen to all clicks because it’s a generic click trigger and just see whether this works for our element. We’re going to save this and before we continue, you need to go under variables here. And actually go to the built-in variable tab and go to configure and make sure under the click section here you have these click triggers actually enabled. You only have to do this once. Once they’re enabled you can use them. Now up here in our preview and debug mode we can go to refresh, you can also click that preview button one more time. And this will refresh our Google Tag Manager in the background. And once we reload the page we should have now the listener functionality installed on our page. Now Google Tag Manager should be able to listen to any kind of click that we do on our website. So for example, I can click it here, click up here, I’m gonna do this with command key press so it opens up in a new tab. Gonna click here, and obviously also on our add to cart click to see whether something moves down here and Google Tag Manager is actually able to pick this up. So I’m gonna click on this add to cart button and I don’t want to be redirected to the next page so I’m gonna do this with the command key pressed. I’m gonna go back here and we can see all these different events.

Now what we want to do is actually go to the second tab called variables here and then go through our events that were transferred to Google Tag Manager. So for example here’s the fourth event, and I’m gonna click on it, we have hit variables, and we can see all the click variables that we have just enabled and can see how they get filled. Now every time you click on a different element, these variables get filled differently. So if you go to this fifth click we can see that things are changing inside of this variable menu. Now if you remember I first clicked on this title here and it had the click text Happy Ninja. We can go to the next one and I clicked on apparently something that’s singles that was right here and this was transferred as the click text. Now you also notice that there are other variables that get filled differently. For example, the click element which is a URL. We see maybe the click URL, this is where we are redirected to. And sometimes we also see click classes or an ID, so if your element in the background of the HTML has classes or an ID, it would be perfect because our trigger actually picks this up and puts it into these variables. And here we see the single add to cart button was clicked. And this is the element that I actually clicked on when I clicked on our add to cart button.

Now the key being here that we need to give our trigger now a rule that he can decide on when to actually fire our tag later on. So we want to make it very unique in order to not get mixed up. We could, for example, choose the click text which is add to cart, and which differs widely from the other click text that we have down here. We could also use the click classes which is pretty unique. So for our case I think the click classes is perfect because the others don’t really get filled here, so click classes already is great. So now we’re gonna go over to our second step to refine the filter. We go over to our trigger again and turn our generic click trigger into a specific one which is specific to our button click. We’re gonna click on the configurations and this time we don’t want to fire our trigger on all clicks but only on some clicks. So you’re gonna go to the some clicks function and then we’re gonna choose the variables that we identify to be unique in our button click. In our case that would be the click element. Now we have different matching options here like RegEx, CSS Selector, and so on. I’m gonna make it easy and just choose the contains option. So if the click element contains and what do we have to put in here? Single add to cart button. Let’s just take this part. Then I want to turn this whole trigger true and fire our tag. So let’s save this and we have now turned our generic click trigger into a specific one.

Now in order to test this out we actually need to first connect this to a tag, and we’re gonna send an event into Google Analytics. So for that we’ll go over to tags, click on new here, and give it a name. Go to tag configurations and I want to send something into Google Analytics, I have universal analytics running. The track tag will be an event, as the category, I’m just gonna type click, and as the action, add to cart. And now I have to define where to send this all. If you already have a Google Analytics setting this variable you can choose that, or go to the override settings in this tag and input your tracking ID. Now the tracking ID is specific to Google Analytics, so let’s go over to Google Analytics and in the admin section of your account, under tracking info, you can find your tracking code. Which is this ID right here. Copy that and put it into this field. Now last but not least we need to connect our tag to a trigger and we have already this part prepared. So here is our button click trigger and you can save this now. And click on our refresh button again, go back to our page, let’s close all these pages here. Reload this page, and click on our add to cart button. I will do this again with the command key pressed. We will open it up in a new tab, but we see down here our fourth event was a GTM click. If I click on this I see that no tag was actually fired, why is that? We can click on our Google Analytics event tag and maybe I did something wrong in the trigger, so I’m gonna scroll down here and I can see that the click trigger failed, so that’s the X here. And I can see that the click element didn’t contain single add to cart button. Now that wonders me, so I need to check out what is the state of the click element. So I’m gonna go over to variables and I see that here it says click element and this was what it was filled with. Now I actually originally wanted to use the click classes, so we can all learn from here you need to have the right variable and the right value in place in order for your trigger to turn true.

So let’s correct this mistake, go over to triggers again. And look quickly in here and we’ll choose the click classes instead of click element. Let’s save this, refresh. Go back to our page, reload. And click on the add to cart again. And this time we should see our tag fired, GTM click. On this click we had our event tag fire. You can also look that up in our tag assistant if there is anything sent to Google Analytics. So here we see one event that happened. And we now should also see this in our Google Analytics account and we go over to the real time reporting and under events we should see a new event entering our account. Now later on you will be able to see such click events under the behavior report under events here and that will give you all the statistics about the different events that came into your account, but this takes up to 48 hours to fill correctly. So now we have deployed our Google Analytics tag.

Now obviously we can also deploy other tags because we already have that trigger now prepared, we can reuse that trigger, so for example here I have a Facebook event that sends over a track event, add to cart, to Facebook. And we can just attach our click trigger to also fire this to Facebook. Or our AdWords conversion tracking if we want to track our add to cart click as a conversion and also use this tag with this trigger. Let’s save this, refresh, go back to our page, reload that. And click on add to cart, see if this all works. And as you see when I clicked on it we had three events fire into AdWords, Facebook, and Google Analytics. You can also see this here in our tag assistant. We have now our Google AdWords conversion tracking, we have our Facebook pixel helper, we also have received our add to cart event. Now once you have made sure that everything of this works correctly, there’s only one step to take this live onto your website and this is actually publishing this as a new version in Google Tag Manager. So click on the submit button here, enter a descriptive name. And then you can publish this onto your website and it will now be tracking the button clicks on that add to cart button for all your users on the website.

Alright, so there you have it, this is how you can track button clicks with the help of Google Tag Manager. If you are new to Google Tag Manager then I encourage you to check out our video playlist for beginners on Google Tag Manager. We have a whole tutorial series on that as well. And if you like this video then please give us a thumb’s up and subscribe to our channel right over there because we bring you new videos just like this one every week. Now my name is Julian, see you in the next one.

Google Analytics – Still the best Tracking tool in 2018?

Google Analytics has been the most used tracking tool for a long time. But there are numerous alternatives out there РSo does GA still fit your needs? Or should you switch or even upgrade to GA360? Let’s weigh the Pros and Cons in this video….

? Links from the video:

Google Analytics 360:


Similar Videos:

Mixpanel vs. Google Analytics
5 Tracking Tools

? Learn more from Measureschool:

?Looking to kick-start your data journey? Hire us:

? Recommended Measure Books:

? Gear we used to produce this video:


– Is Google Analytics still the best tool that you can use on your website in 2018? Well, let’s find out.

Hey there and welcome back to another video of teaching you the data-driven way of digital marketing. My name is Julian and today we wanna talk about Google Analytics and if it’s still the best analytics tool out there that you can use for your website tracking in 2018. Now, it’s definitely very popular. I actually use it religiously and I have many clients running on Google Analytics but there are certain circumstances where I would recommend a different tool.

Now, what are the advantages and disadvantages of this number one analytics tool out there? Let’s dive into some of the pro and cons. So, the number one or that everybody can think of when they think of Google Analytics is that it’s free. Now, Google Analytics came out with a free version after they bought a company called Urchin and made that website data available to their advertisers of AdWords so they can make better decisions on changing around their website and convert more people and spend more money on advertising but the tool was really powerful already at the beginning, so it widely spread all over the world and is now one of the most used analytics systems out there for website tracking. That obviously brings a lot of perks to the system. It is gathering a lot of data, it has huge support out there, so if you have any question, you can go into one of the forums and find out what you can do about your problem and since it’s connected to AdWords and that is Google’s money maker still they actually invest into the tool on a continuous basis so there are always new features coming out which is also great but on the con side the free model is not the holy grail and that’s what Google actually also discovered and they brought out a paid version of Google Analytics in their marketing suite Google 360.

You can pay everything from $20,000 a month upwards to actually get better and more data into your analytics system but also the other systems that they have out there and really get better data here. So, up to a certain level, Google Analytics is free but once you get more sophisticated, especially the sampling issue that you have in the free version is pretty annoying, then you might need to think about different systems that are out there and Google Analytics is just one of the many paid systems that you can install on your website and get click stream data from. Now, on the pro side it is pretty feature rich. Now, you need to think that the system Urchin was actually a paid product before and then Google brought it out continuously evolved it, so it has a lot, a lot of features that you can implement and customize in your Google Analytics installation and that’s a good thing, right? Well, only kind of because on the con side, Google Analytics gives you a very strict model on how to look at the data. Now, this is mainly based on their model of page view data, so when we think back 10 years, analytics and websites were not that complex and therefore Google Analytics built on that model of page views and sessions and users and they calculate a lot through that. That brought in a lot of problems as well because we had a lot of privacy issues, we have different features that we should be able to track and to use but we can’t connect that to data, the data is stored in the US so it’s under US privacy laws. That’s what the Europeans don’t really like and that’s why you can’t send any personal identifiable information into Google Analytics which is not really suited to our business model.

So, yes, Google Analytics has a lot of features but maybe you are better off with a different tool that gives you more specialized data that can connect to your business model better and give you better data and more meaningful data for your business and it’s maybe possible to build it into Google Analytics but not the best way to look at that data later on. So, be aware of these limitations once you start customizing your installation which brings us to our next point, the plus side, Google Analytics is customizable, so it’s not just out of the box although you can use it out of the box and just track page views which is not worth much anymore but you can customize a lot, so from event tracking to actually sending user IDs or custom dimensions, custom metrics, you can really spice up your tracking and transfer the requirements of your business model to this tool as well. Now, on the con side here again we have more specialized tools that might be able to track your business better. In that sense we might have different business models with mobile apps or gaming that might be suited for a different tool a little bit better or if you need to have very deep insights about your customers’ behavior because they log into your system, maybe Google Analytics is not the right tool because it makes it really hard to connect that data back and forth with personal identifiable information because they’re not allowed to send that in. So, different other tools like Mixpanel or Kissmetrics have a different model in the background and are specialized on these different customizations that you can do on the tool. So, keep that in mind, once you try to transfer your business model to your tracking model, and try to input that into Google Analytics and customize it. And last but not least, the connections. Now, on the plus side, Google Analytics is well connected. We get information automatically from AdWords, we can send it to Google Data Studio, we have Google Tag Manager available, so well-connected tool. Also, on the third-party front we have different other tools like super metrics that let us pull the data right into Google Sheets or different plugins on the WordPress side that let us install Google Analytics really easily. It’s wildly used and therefore it has very many connections out there to actually pull data in, pull data out and connect Google Analytics to different systems but on the negative side, we actually don’t get access to the raw data.

Now, in essence, Google Analytics just takes up our data and puts it into a bucket of page views and that data is very valuable if you wanted to connect it to different other tools or wanted to do deeper analysis on this raw data but Google Analytics by default at least in the free version doesn’t give us this data, so other systems might be more useful in that sense if you think about Snowplow analytics that let’s you build your own data service and when it comes to privacy reasons obviously you also want to keep your data on your own servers and that’s simply something that Google Analytics doesn’t give you once you have the free version of Google Analytics.

So, in conclusion is Google Analytics still the tool that you should be using in 2018 for your website tracking? Now, it depends. In the end, if you are heavily into customization and really want to have a business impact with your analytics, then you probably have the manpower and team and resources out there to actually search for a better solution of Google Analytics out there. If you’re not yet at that stage where you really want to make an impact with your analytics and just need standard tracking data to optimize your marketing campaigns, then Google Analytics is still one of the tools out there that is well supported, that is free and it gives you standardized data that a lot of the marketers out there understand, so I would still install it on our website but also look out for other tools that may make my analytics implementation a bit more customizable, so if I think about heat map tracking, video tracking or simply data that I can send to different other marketing tools so I can make it really actionable that might be for example Facebook analytics and the Facebook Pixel, then I really want to stress that you don’t just have to Google Analytics. It gives you some base tracking data but see what other questions, what other data you can get from other analytics systems, maybe try them out and put them onto your website as well. And that’s already it with this week’s video. If you have any questions about this or anything was missing or if you see any kind of new advantages or cons that I have missed, then I’d love to hear from you. Please leave that in the comments below and if you haven’t yet, then consider subscribing to our channel right over because we’ll bring you new video just like this one every week. Now, my name is Julian, til next time.

5 Google Analytics Tracking Techniques You Should be Using

Google Analytics tracks Pageview by default, but there is a lot of data that needs to be setup additionally to fully complete a Tracking installation. In this video we are going to take a look at 5 Tracking Techniques you should be using in your Analytics setup.

Links mentioned in the video:
Conversion Tracking:
Source Tracking:
Event Tracking with GTM:
Site Search Tracking:
Error Tracking:
Visitor Labelling:


Learn more from Measureschool:

Looking to kick-start your data journey? Hire us:

Recommended Measure Books:

Gear we used to produce this video:


In this video I’m gonna show you five tracking techniques that I’m using to spice up tracking installations. All and more coming up.

Hey there and welcome back to another video of teaching you the data-driven way of digital marketing. My name is Julian and on this channel we do marketing tech reviews, tutorials and the occasional tips and tricks video just like this one. So, if you haven’t yet, consider subscribing and if you haven’t yet, then also click that bell notification icon so you’ll stay up to date with all the videos that come out on this channel.

Now, today we want to talk about five techniques that you can use to spice up your tracking with Google Analytics, Google AdWords but also other marketing tools out there and get better data with your tracking. Now, these are really basic tracking techniques out there but you might find that you haven’t really thought about one or the other techniques, so definitely let me know in the description below if I missed anything that you would like to see in this video as well. Now, we’ve got lots to cover, so let’s dive in.

So, the first tracking technique that you really need to take care of is your source or your campaign tracking. Now, in Google Analytics it’s already tracking a lot of sources by default, so when a user comes from one website to your website, then you can see that in the source reports or your campaign reports in Google Analytics or on other tools but sometimes you want to be very explicit about where the user actually came from, that might be the case when he come from an advertising or an email campaign because sometimes this actually gets obscured in your Google Analytics and then it goes direct into the direct none column and that’s their traffic, you don’t really know where your traffic is coming then from and therefore you should be tracking your campaigns correctly. Now, this is normally done with UTM parameters. If you want to know how to use them, then check out this video right here. But once you have them set up and know how to use them regularly when you put a new marketing campaigns, then you can get a rock solid tracking on where your traffic is coming from, where your sessions are generated from and even transfer that information further into other tracking tools, into other marketing systems, into other CRM systems so you will always know where the user originally came from once he entered your website.

Now, the second tracking technique that is very basic but a lot of people don’t have it installed is conversion tracking or goal tracking, how you call it in Google Analytics. Now, this all about the most important interactions that a user takes on your website. That might be a click, an interaction with a form or visiting a certain page on your website that is very important that actually signifies that the user has reached a certain goal or is converted or can be counted as a conversion. So, really make sure that you have something like this set up in your tracking systems in Google Analytics that would be done through goals. In something like Facebook, you would send a purchase event for example when the user has purchased something and that is interactions that you need to track in these tools in order to connect your existing data, your existing page U data with that one goal, so how many people actually converted or how many people that did one interaction also did this very important interaction. That will always give you a goal post and a better comparison of the data at hand.

Now, the third point is a bit broad but this is all about event tracking, so the interactions that a user can take on your website. By default, Google Analytics and most of the tracking tools out there do click stream analysis, so they actually send over data point once the user enters a web page and this is commonly also referred as a page U. Now, a user, especially with newer websites can do much more on a website than just go from one page to the next page to the next page, but also do interactions, so for example, click on something that changes something on your page, they can scroll down, they can view a video and so on, these are all interactions that are trackable. We have tons of videos on this channel that show you how to track certain interactions on this page with the help of Google Tag Manager which is my preferred way of doing things when it comes to event tracking but you could also build that into different other systems and make use of that but the interaction data gets very important and more and more important so in the context of tracking your website user, so definitely think about all the interactions that a user can take on your page and how important those can be for your tracking as well and how much more data you can gather that is important let you make better decisions on your analytics. Now, just to give you some example, there’s outbound link click tracking, there is form submit tracking, there’s scroll tracking, there is interaction tracking with a video or a certain element on the page. I really love the new trigger, the visibility tracking within Google Tag Manager, so you can track when something pops up on the screen and the user actually sees it. So, these all interactions that might be very relevant for your user and also could feed into the conversion tracking later, so definitely think about event tracking in your tracking setup.

Now, number four here is an oldie but goodie and this is the site search tracking. Now, this is all about if you have a search bar or a search field on your website where the user can look through your website, defined to your website. You should definitely track that because it holds a lot of value about what the user is thinking at the time of what he is searching for so you can track the intent of the user. Now, Google famously took away these keyword data that we were used to get from Google directly once the user came to our page and we could see our keyword reports in Google Analytics. That’s not very accurate anymore but the site search tracking is your next best bet to actually find out what are the users that are actually already on your website searching for and wanting to find on your website and maybe even combine that with a search result page that has zero results. How could you make this better or maybe build more relevant pages or find more relevant products for the user, create research tool as well. So, definitely install site search tracking on your website in order to pick up these search intents from your users.

And last but not least, number five, the error tracking. So, you know these nasty errors that come up when somebody comes from a search engine to your website and doesn’t find a website, a 404 error is most commonly showed to the user and these can actually be tracked, so every time somebody comes to a 404 error page, you should track that, for example, as an event in Google Analytics but also where the user actually came from and what he requested, what kind of resource did he request. That’s very important to later go through and find out what are the pages that are maybe broken on my website or that I have linked up incorrectly and then you can correct that on your website or redirect the user to a relevant page and helps so the user doesn’t leave your website right away. So, these are the five tracking techniques that you definitely should be using.

One bonus tip here, number six is actually the visitor labeling. So, once a visitor comes to your website, a visitor is just an anonymous person coming to your website but for example, he undertakes maybe an interaction like a log in or he does something like sends out a form field, then he becomes something else, he becomes a user that actually interacted in a certain given way with your website and maybe can be classified as a certain different type of visitor and that is information that you also should be tracking in your analytics systems. So, maybe you can then segment your users into paying customers, to regular users, returning users, or people who have already an account with your company and that will make your work in Google Analytics and in the analysis later on so much easier because you can actually segment and filter those people out and only look at certain given groups that actually make sense for your analysis. So, definitely think about the visitor labeling as a tracking technique as well.

And that’s already it with this week’s video. If you found something that was missing and you always install with your Google Analytics installations, or with any other tracking setup, then I’d love to hear from you in the comments below if I forgot anything and if you like this video and it helped you out, then why not give us a thumbs up, share it to a friend or a colleague and definitely also subscribe to our channel, click that bell notification icon because we’ll bring you new videos just like this one every week. Now, my name is Julian, til next time.