Wednesday, July 28, 2010

How to Track Videos, PDF downloads in your website

With the help of Google Event tracking code you can track the video download, widgets, pdf, white paper download on your site. You can also find out which particular logo, quotes user are clicking more etc. Installing Google Analytic Event Tracking code is simple, it involve following steps.

First of all your site page must have installed the Google Analytic Code, for GA code installation you can read how to track visitors in your site with Google Analytics , in my previous post. And if Google Analytics is already is installed in your site pages, then make sure you are using the latest applicable script of Google Analytics. Event tracking code works with new ga.js tracking code. Google Analytic code is a small java script code that you have pasted in your site pages.

Google Analytic Event Tracking Code is

_trackEvent(category,action,opt_label,opt_value)

Category, action are required components where as label and value are optional components. Lets understand what exactly these meaning
Category
Here category is name of object which you want to track like video, PDF etc.
Action
Action means what type of action vistor had taken, e.g. in video category it can be play,download etc.
Label
Label is optional, you can use label for extra information like particular name of video or name of pdf file
Value
You can use value for more information like time for a video download in your site

Just install this code before the event you want to track, e.g. in order to track how many times your video Played use

 onClick="_gaq.push(['_trackEvent', 'Videos', 'Play', 'Everything i do']);">Play

In this code Videos is "category", "Play" is action, and "everything i do" is label.

In order to track how many times video downloaded, tracking code will be

_gaq.push(['_trackEvent', 'Videos', 'download', 'Everything i do']);">

Similarly you want to track PDF downloads to your site, you can use this tracking code

pageTracker._trackEvent('Downloads', 'PDF', '/CaseStudy/orderForm1.pdf');

You can check the event tracking in your Google Analytic dashboard, inside content section as Event Tracking

No comments:

Post a Comment