Who Clicked on My Website Links?

I had a conversation with a friend few weeks ago. He has recently realized that I am his “Analytics BFF” and asks me quiet a number of questions, and to be honest with you I like it cause I learn a lot about average person’s view on analytics by that. Anyway, he was wondering where to see link clicks report in Google Anlaytics. Don’t blame him, he is very new to this stuff, but enthusiastic.

It is important to know that a default setup and installation of Google Analytics only collects page load data. There is no such a thing like click tracking if you simply copied and pasted the GATC (Google Analytics Tracking Code) in your website. Well, it is actually not a case for Google Analytics only but for most other clickstream tools in the market, however we are supposed to talk about GA in this post, right?

Let me give you a better understanding of what you miss by not having click data, which actually, in my opinion, can be one of the major KPI to measure outcomein a non e-commerce website. It is also a great metrics for usability analysis.

Now, let’s assume you sell cars, and people come to your website, look around, spend time and at the end download a brochure in PDF format. It is one the valuable outcome of your website, and you should be able to measure it.

There is no page load as a result of a file download, and you don’t want to create a proxy page to load when someone requests a download. Alas, in no way loading a proxy page represents the file download itself anyway. On top of that, it adds one unnecessary step to user experience and I am not sure how happy they will be with that.

Another example is when you have a website with lots of outbound links, let’s say a Yellowpage, or when you sell pictures or music, that makes it extremely vital for you and our business to measure the clicks. A form submit button is another example. You’ll get the lead anyway in your database after someone submitted the form, but if you are not collecting analytics data, how would you be able to measure performance of traffic sources per leads?

These are just a few examples and complete list is endless. Good news is that click Tracking is possible in Google Analytics, but you need to spend a bit of extra time and effort to make it work.

So I am going to show you a very simple way for doing it and I call this method Virtual Page Load. By that you will send a fake page load event to Google Analytics anytime a click happens, as if a real page load occurred, and later you will be able to look at it in the reports.

The way we do it is as simple as adding a small script to <a> tag on your page. As an example let’s assume you have a link on you page that sends visitors to Huffington Post like this:

< a href=”http://www.huffingtonpost.ca/”>Huffington Post<a>

Now what I do is to add following script to the hatml tag:

<a  onclick=”_gaq.push([‘_trackPageview’, ‘/outbound/huffingtonpost’]);”  href=”http://www.huffingtonpost.ca/”>Huffington Post<a>

By doing that, anytime a visitor clicks on this link, it will send an event to Google Analytics as if a page named huffingtonpost in /outbound/ directory on your website is loaded. Obviousey you need a standard naming convention for those fake files and directories, simple rule is that never use existing folder name, and always pick something relevant to the link and target name.

Google Analytics will show that in content report, and you can drill down into it for more detail, use it  in goal definitions, filter it, segment it, and all other use of a real page load metric.

Virtual Page View in Google Analytics Report

Fake Page and Directories in Google Analytics Report

Sweet hah? There is another way for doing outbound link tracking and it is a little bit complicated. Click to read it at Google Support site and send me fake page view events.


Leave a Reply

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