A lot of you have asked me how I track things like affiliate link clicks, email signups and such things with Google Analytics. The short answer is with Google Analytics event tracking!
So I decided to put a quick Google Analytics event tracking tutorial together to show you how you can do the same.
What You Will Learn
- How to track anything with Google Analytics
- Including affiliate clicks, email sign ups, shopping funnels & more
- How to setup event tracking & goal tracking
- All of my Google Analytics event tracking best practices
- How to work out the monetary value of a conversion easily
- Get access to my personal custom Google Analytics report
My previous tutorial will also teach you how to increase traffic with Google Analytics.
Google Analytics Event Tracking Tutorial
Don’t worry it is much easier than you think! Just follow along with my live Google Analytics event tracking example-
Hi guys Matthew Woodward here and today you are going to learn how to track anything with Google Analytics event tracking, I know a lot of you have asked for this so here it is.
You will learn how to track affiliate clicks, email sign ups, shopping carts and much more.
I’ll also teach you how to work out the monetary value of an affiliate click, email sign up or any other action in seconds.
And I will be sharing my personal custom report that I use to work out which traffic sources and which content is driving the best conversions!
Let’s get stuck in.
This is the main dashboard for my blog in Analytics and if we come down to content, events, we can see its tracking all sorts of different events including affiliate clicks, downloads of resources, people subscribing to RSS and the lead player videos also seem to create their own events automatically for you so you can see when a video has been loaded, played, the optin displayed, how many people submitted on the optin and things like that.
If we click into the affiliate event category and look at the label we can see exactly which pages have driven how many affiliate clicks over a time period and we can come and take a look at exactly which programs have received the most affiliate clicks.
Moving on from there you can then setup goals and goals allow you to attract the conversion rate of such things along with here we can also see people subscribing to the email list and if you come up here you can track that kind of information here.
Other things you can do once you’ve setup events and goals, you can setup custom dashboards for example I’ve got an email sign up performance dashboard here and exactly where the sources are coming from and which pages are driving that.
You can also use just an easy dashboard here that’s tracking everything for me. Email completions, affiliate clicks and resource downloads.On top of that you can actually create your own custom reports and if you take a look at this I actually create a report to measure the performance of traffic.
So you can see things like blackhatworld send 3.98% conversion rate to email subscriptions whereas warrior forum is 10.92% and trafficplanet 3.37% so you can quickly see where you should spend your efforts if your key goal is to drive email subscribers and we’ve got the same here for affiliate clicks.
People from youtube 46% of them clicked an affiliate link whereas only 25% from blackhatworld. And again I can come and now look at the same metrics broken down by content and see exactly which content is driving email subscriptions, affiliate clicks, resource downloads and such things.
So this custom report you’re going to be able to download underneath the video on my blog. You’ll be able to add it into your analytics setup in just 1 click and I’m going to take you through now how we setup and track all of the different events which include the affiliate clicks, resource download, rss subscriptions and I’ll show you the leadplayer video integration because that’s pretty easy as well.
And then once we’ve done that we are going to setup the various goals which will allow us to track all the conversion rates and build our custom reports. So let’s get started.
Event tracking can be used to track anything that the user clicks on, this can be anything like an affiliate link, clicking a buy button and so on.All you have to do is add this code to your links, don’t worry if it looks scary at the moment its really simple to apply.
If you look at the code we want to replace 3 values, the category, action and label. The category is the category or type of event such as affiliate click or video if you’re tracking video plays etc
The action is just a name for the action user takes, this could be play if tracking video but I use the affiliate programme name here if tracking affiliate clicks.
Lastly the label can be anything you want, I use the page URL here though.
Let’s take a look at a live example, this is what the event tracking code template looks like.
And this is what the code of an affiliate link looks like for Ahrefs.
The edited coded looks like this, you can see the ‘Category’ has been changed to Affiliate, the Action changed to the affiliate program which is Ahrefs and the label has been changed to the pages URL.
And you can see the difference between the normal affiliate link and the finished product, essentially what we have done is just copy and paste the onclick statement into the link itself.
And what that produces is when you come to event category it says affiliate and then you can look at the event label which is the URL or the event action which in my case is the affiliate name. So there is ahrefs, the label we set and here are the different labels or URL that are sending that affiliate program traffic.
Now if we come across to my blog here and here is an affiliate link, you can see this in action live and you can see here the onclick track event affiliate Bluehost and the URL its coming from.
And I also have this if you download, share the page socially and download one of these packs if we inspect that you can see here this time instead of affiliate its download, the resource number so this is resources number 1, thats number 2, thats number 3 tutorial resources 1 and the URL its coming from.
And we can also come and take a look at the RSS here, inspect element. Trackevent, RSS, subscribe the URL its coming from and I have this in place on every single affiliate link on the blog which I have to setup manually it does take a bit of time when producing a posts like this kind of thing but as you can see its well worthwhile doing.
Let me just show you here again, inspect the element and there you can see trackevent, affiliate, seopowersuite, tools of the trade even these links track event, affiliate, so every single link here is tracked.
It’s worth spending the time setting all of this up and once you have setup all of the events for things that involve a click you can move onto the next part which is setting up the goals and we will also look at setting up the tracking of email subscriptions and that kind of thing which we don’t need to add any special code to do.
Once you have set things up and you’re getting data coming through in the events section here, it will take about 24 hours for data to appear once you’ve set everything up but then you need to move into creating goals for the events you have got.
So to do that you come into the admin section, select the profile and come to goals and you can see I’ve got some setup here but I’m going to show you quickly how to create a goal.
So tracking or creating the goal for the affiliate click, we have a few options here i’m just going to choose custom and hit next step. You can give the goal a description so that might be affiliate click and you can change how you track it.
So we want to register a goal every time the affiliate event happens. So we can select event, hit next step and now it allows us to choose a category, action or label that we have defined earlier.
Now we know we called our category affiliate for all of the affiliate links and we can just quickly verify this goal and it tells us that 5.58% of people in the last 7 days have met this criteria so we know its setup correctly. You can also define a value for a goal conversion so every time a goal happens you can assign a monetary value to it.
Now this is often hard to do with affiliate clicks because you don’t know many of those convert and everything like that but I’ve actually got a little formula that I’m going to teach you a little bit later on in this tutorial to work out what value to put into things like an affiliate click or email sign up or things like that.
Anyway once done you would click create goal, I’m not going to because mine are already setup but then if you then wanted to setup a goal to track RSS clicks, again similar setup, custom, next, RSS, tracking an event, category is equal to RSS verify this goal and we can see that matches.
So setup your goals for each of the events that you have setup and then you can look at setting up the email subscription tracking.
Now tracking the email sign ups is really easy on my blog no matter where you sign up, whether it’s this form here, this form here or one in line with posts as soon as you hit subscribe now you get taken to this page which asks you to check your email and click the confirmation link.
Pretty standard procedure really and this url is almost-done now the only way to get to this page is by submitting a form. So anyone that hits this page has had their email added to aweber and now they just need to login and confirm it.
Once they open the email and click the confirmation link they get to this page, thank you for signing up. Their email is now confirmed they are on my list ready to receive my emails.
So no matter what happens people must always hit the almost-done page and then lastly the thank-you page and make a note of the URL’s there.
So in Google Analytics to track the email sign up all we need to do is click on create a goal, here we can select a sign up, next step, give it a description so email subscribe and then this time we are going to choose destination as the type and hit next step.
Now the final destination, the point that the final conversion takes place is after the user has confirmed their email address. Once they hit this final page in the sequence. That counts as an email subscription.
So you can take that URL and paste it in here. You can give it a test here and double check that’s working and you can see 0.92% of people in the last 7 days have hit this page.
You can then define a funnel and what happens is, no matter what page they come from. They always come to this page and then they always go to that page. This is the email sign up funnel.
Enter your email address, please confirm your email, thank you for confirming. So if we take the URL of the almost done page we can say that first they have to hit the please confirm stage and this is the page that they will see and it is a required step.
So in order for this to register as someone subscribing to the email list, they must hit that page then they must hit that page and that counts as a valid subscription.
Again you can reverify here to make sure your new funnel is working and here you can see that 0.92% conversion rate. So you would just click on create goal and that is the goal completed for you.
It’s also worth noting that you can use this setup to track any type of funnel whether that’s an ecommerce funnel and a checkout when someone’s added a product to a basket, views the basket, checks out and then thank you for order page.
You can track any funnel with this and as you can see here you can add and remove steps as you wish. Not everyone takes people to a please confirm your email page, you might go straight from the opt in to the thank you with no confirmation. In which case you could just remove this step and just have it tracking directly from here to here.
So feel free to tweak this goal setup and create funnels for any type of action the user may take on your site. It’s not just limited to email subscriptions in fact back here you can see the different things they recommend you track.
So let’s move onto assigning goals a value and how to come up with a monetary value for each metric that your tracking. Now putting a monetary value on goals is a great way to get a rough indication of how the site is performing. It’s not an exact science it’s just a guidance and this is something I haven’t really set up on this blog so let’s do it right now live with you guys.
So I have got this spreadsheet and you can see this is the performance of the blog across the last 3 months and how much it has generated and what I want to find out is how many affiliate clicks did I have in that same period and how many email signups.
So if we jump to analytics and come to conversions and goals and overview and the data period is the same, 1st of April to the end of June. You can see there were 892 subscriptions to the email list in that time and we put that there.
And there we 6276 affiliate clicks in that time. Now as a rough estimation you can take the total amount of money earnt in that period and divide it by the number of affiliate clicks to work out roughly how much each affiliate click is worth so we can say equals that divide by that and each affiliate click is worth to me about $3.32 and you can do the same formula for email sign ups.
And an email sign up is worth to me around $23.38. Now I know that this is not an exact science because this number isn’t really broken down like this and this calculation assumes there were no email signups or now affiliate clicks they are totally independent of each other.
But it’s a nice way to put a rough kind of estimation on what each of these events or goals are worth to you. So adding an event in or the value to the goal in is pretty easy. You can come back to goals here and this is my affiliate link goal right now and I can say yes, oop sorry use the event value as the goal value for the conversion, no and my custom affiliate click value is $3.32 so I can change that there, save goal.
And now to email list I can come here, value, on and the value here was 23.38 and hit save goal and from this point onwards analytics will now track that goal value you can see here I just had random values assigned previously I think it was $1 on the email sign up at $0.10 on the affiliate clicks so it wasn’t really based on anything.
But now from this day on it will track the value I have just inputted based on the last 3 months actual performance of the blog.
So that’s how you put the value against goals so just to recap your knowledge quickly. The other week I integrated LeadPlayer Videos which introduced all of these cool events allowing you to track when a video was loaded, when it was played, when an opt in displayed, when a call to action was displayed, how many people clicked the call to action and so forth.
But I haven’t actually added these as goals yet, so let’s take a look at how we do that. If we jump over to goals, the first goal I’m going to track is the call to action click which in essence is an affiliate click so we can create a goal.
Custom, and call it video affiliate click and we are going to track an event which is equal to the category leadplayer videos, the action is calltoaction-click and the label I’m not bothered about what does it actually track as the label, ahh exactly which page it came from.
So we know that an affiliate click is worth roughly $3.32 to us so we can add that as a value here, verify this goal and this will check and tell us the conversion rate that we are seeing here and click on create goal.
Now I want to do exactly the same but this time for video opt ins. So this time we are going to go sign up, oh no custom, video optin and that’s going to be an event, next step.
Again here the category we can come back and check leadplayer videos check that’s right, yep. And we are looking for the event action optin-submit and just verify that quickly and you can see that’s working nicely there and the goal value is going to be $23.38, create goal.
So now you can see I am tracking also my video affiliate clicks and video optins based on the events that leadplayer was automatically pushing into here and as you can see I’ve not actually been using it that long just yet.
So now you’ve got it all setup you can come and download my custom report the link to do so is available underneath the video on my blog. You’ll be able to import this exact report in one click that breaks down the performance of first of all your traffic sources and then it allows you to easily identify which ones click on affiliate links more and which ones sign up to email lists more and such things.
You’ll also be able to analyse your content and see exactly which content is driving more email subscriptions and which ones are driving more affiliate link clicks.
Once you import this into your analytics account if any of these numbers aren’t showing what you need to do is come up to edit here and just change these fields.
So if you click on this drop down, select email you’ll want whatever your goal for email list completions is here and here whatever your goal name is for email list conversions here. So email completion, email conversion, affiliate completion, affiliate conversion you probably won’t track resource downloads this is custom to what I do so I will actually remove these before I share this report with you.
So that’s it now you know exactly how to track everything with analytics, go and get it all setup!
Essentially you can track anything that happens on a website from someone click on a link to someone converting as an email subscription.
Here is a basic example of how to use event tracking to track affiliate links-
The default Google Analytics event tracking code looks like this-
onclick="_gaq.push(['_trackEvent', 'category', 'action', 'label']);"
We want to replace 3 values-
- Category – The category/type of event, e.g. Affiliate Click
- Action – Give the action a name, eg click (I use affiliate programme name here)
- Label – Anything else you want to include (I use the page URL)
So track an affiliate link click for Ahrefs on the tools of the trade page it would look like this-
onclick="_gaq.push(['_trackEvent', 'Affiliate', 'Ahrefs', '/tools-of-the-trade/']);"
Now we just need to add it to our usual affiliate link that looks like this-
Which ends up looking like this-
Everytime someone clicks on that affiliate link, Google Analytics event tracking will log it was an affiliate link click for Ahrefs and the page it came from.
Please see the video for more detailed setup instructions and learn how to track other things like email subscriptions, signups & shopping carts!
Custom Reporting With Events & Goals
Once setup you can create custom reports that tell you a bunch of things like-
- Which traffic source sent the most opt in conversions
- Which page converts the most affiliate clicks
- Which affiliate program is performing the best for which traffic source
This is what my custom Google Analytics event tracking report looks like (you can get it below)-
Straight away you can see 10.9% of traffic from the WarriorForum signs up to my email list while only 3.4% do from TrafficPlanet.
Equally you can see 46.1% of YouTube traffic clicks an affiliate link compared to just 25.8% from BlackHatWorld.