Google Analytics Tracking Code

Episode 11 Digital Marketing Video

PPC Video
7 mins

Without using tracking code for you website links, Google analytics won’t be giving full details on the effectiveness of your digital marketing efforts. This video walks you through what URL tracking code is and how to use it. Using the Google URL Builder set by step, you’ll see and understand each element of the tracking code including campaign source, medium and name. It also explores why it's essential for email marketing and how you can integrate its usage into your social media efforts using the Hootsuite tool.


Hi, I'm Daniel Rowles from Target Internet, and in this video we're going to be talking about Google Analytics tracking code. Now tracking code confuses a few people, because there's a few different elements of Google Analytics we need to think about. There's the code that goes onto your web pages to set Google Analytics up in the first place. We'll not talk about that. There's also Google Analytics goals, and we'll not talk about those. What we're talking about is code that goes onto your links so that when somebody links from another website or a social platform through to your website, you can track it in a bit more detail.

One of the first questions that normally comes up, you're saying, "Well in my analytics, I can look at my acquisition report anywhere," and that acquisition report tells you where people have come from, which is absolutely true. You might be thinking, "Well why would I bother doing this, because I can already see where people have come from?" That acquisition report isn't perfect. Let me just give you an example. The acquisition report, for example, if you have people clicking through from an email through to your website, and you don't have tracking code, which is what we're going to speak about in a bit more detail in a moment, on that email, in your analytics they will show up as people that are direct visitors. It's direct traffic.

What does that mean? Well, direct traffic is supposed to be people that go into their browser and they type in your website address and they come straight to your website without coming from anywhere else. But what direct traffic really means is that Google doesn't know where you've come from. So basically what happens is someone opens up your email, they click on a link, it comes through to the website, and they don't know where you've come from, so they report it as direct traffic, not as email traffic. So you need to add tracking code in that scenario.

Give you another scenario, some advertising website and they've got a banner ad. And that banner ad, people are clicking to come to my website. But I've done five different versions of that ad. I'll be able to see people are coming from that website through to my website, but I won't know which version of the banner they clicked on. Equally, I might write five tweets about the same piece of content. I can see I've got people coming through from Twitter to that piece of content, but I don't know which tweet in particular they clicked on.

So there's a number of different scenarios where you might want to have a bit more detail, and that's why we'd use tracking code. Tracking code is also referred to as URL tracking code. It's referred to as URL variables. It's all the same thing. What it is basically if you've got the link to, you add something to the end of that. Now, you can do it manually, but probably the easiest way of doing it, if you just search the phrase "URL builder," you'll get the Google Analytics URL builder. Other analytics packages work in a very similar way, but they have their own versions of doing this.

But the URL builder, you can go through and you can put three key things in. You go through first of all, and you go and put the source, so the campaign source. What's the campaign source? Well, it's basically your winter campaign, your summer campaign, whatever it may be. You can decide how you name them. Then, you go through and you give it a medium, and this is the important one. So you might say "email," or "social," or "pay per click." And fundamentally, by giving it that medium, then it can give you a bit more detail in your analytics where that person's come from. Finally, you need to give it a name, so I might call this "banner one," "banner two," "banner three," and so on, and I could give them different names in here as well.

You fill it in, and then you also go through and you put in your original URL. So I've gone in and put I've gone through giving it the overall name of the campaign, the source. I've gone through and given it the actual medium. Then, I've given the particular link name as well. Fill in those three fields really easy, hit submit, and it will give me the same link back, but with all these additional variables appended to the end of it, so it will just give you a much longer link. You then take that link, and that's the link you put into an email that people are going to actually click through to go through to. Or, it's going to be what happens when somebody clicks on your banner to go through to your website.

In your email system, they don't need to see this really long link. It can be behind the words that you're linking through to, but it's the destination that people are actually going through to. In your banners people won't see, it won't make any difference to them what they click on. It's not going to change their experience. It's just going to give some additional information through to your Google Analytics.

You can also, if you're thinking about this, if you're using Twitter for example, and use URL shorteners, you can put the very long link into a URL shortener, and it will still work. So you can hide it away from people as well. And actually, if you use Hootsuite, so Hootsuite is a social media management tool...Actually, if you're going through and putting your links into Hootsuite, you'll notice where you put your link in, there's a little cog. If you click on that it gives you some information about some settings with your links, and you can select Google Analytics. You can set it up that every single link that you put into Hootsuite can actually have the Google Analytics code in it automatically as well. And you could automatically shorten that as well. So if you're doing social media, you can do this stuff fairly easily as well using something like Hootsuite.

So the tracking code just gives you a bit more information within your analytics about what people have clicked on. If you're just trying to work out which websites people have clicked on, you probably don't need to use this. But if you're doing multiple versions of banners, if you're doing email campaigns, multiple tweets to the same content, it's a great idea to do this.

Now one thing to be careful of is that if you've got a large organization, lots of people could be using this, and I might call my emails "email." You might call them "email marketing." Someone else might call them "eshot." You need to basically go through and create some standards about how you're going to use these different words, and what that normally means is creating some sort of centralized spreadsheet, where you can say, "I call this campaign this and this is how we mark up our emails and so on as well."

So search the word "URL builder." There's a great form that you can fill in. It's got step by step instructions for going through and understanding this as well. And then when people click on those links, you go through to your Google Analytics reports and you can see in more detail where people are coming from.

And there is a specific report in the acquisition report, which is the one that tells you where people have come through to find your website, that's called "campaigns." And under campaigns, out of all this different information you put in, and you'll be able to see how many people are clicking on the different things that you've created. It will give you a lot more tracking, to actually get information about what you've been putting out there into the world. Another scenario you might want to use this is when you're creating PDFs. If you've got downloadable PDFs on your website, actually if you put that tracking code into those links, you're still going to get that information through.

So lots of different scenarios for using this. It's going to help you in your analytics just to get a bit more detail where people have come from, and it's absolutely essential if you're doing email marketing.

Build a ü free personalised ¥ learning plan to see our course recommendations î for you

Free for 30 days

å Related resources

Build a å free personalised ¥ learning plan to see our course recommendations î for you

Free for 30 days