How to use Google Analytics Event Tracking to track your clicks and impressions

Most directory and listing websites on the internet need to record how many times their listings have been viewed by visitors and how many have clicked on them. Not only that they need to discount the impressions and clicks of search engine crawlers and spam bots from the actual data so that their data is correct and they have a clear picture of the ROI they are generating.

The most obvious way would be to record all this information into the database however this would not be ideal in the following cases

1. If the same visitor refreshes the listing page several times the data would not be accurate as the code would run each time the page is refreshed.
2. The database size could grow at an exponential rate and even if it’s manageable the amount of redundant data would not help in identifying correct ROI.
3. Members and investors of the website would not get the complete picture and this may increase frustration levels.

Enter Google Analytics!

Google Analytics to the rescue
Google Analytics to the rescue

Google Analytics provides a feature called Event Tracking which helps website owners to record information such as impressions and clicks very easily. You just need to add a one line JavaScript code and you are in business.

For e.g. if you are trying to record impressions on a business listing page you could put in the following code.

_gaq.push([‘_trackEvent’, ‘Business’, ‘Listing’, ‘Business Name here’]);

If you are trying to record the number of clicks for that business you can add the following line to your anchor tag (<a>)

_gaq.push([‘_trackEvent’, ‘Business’, ‘Click’, ‘Business Name here’]);

If you would like to know how you want to place this line in your anchor tag then please see below

<a href=”javascript:;” onclick=”javascript:_gaq.push([‘_trackEvent’, ‘Business’, ‘Click’, ‘Business Name here’]);”>Business Name</a>

The best part is that Google discounts redundant clicks and impressions as well as search engine crawlers and spam bots from its data so you can have the accurate picture.

Hope the above helped!

Leave a Comment