Before we start, make sure you are using the new Analytics code. To check if you are using new code or not, here is a sample of new code:
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : " http://www.");
var pageTracker = _gat._getTracker("UA-XXXXXX-X ");
You can get the step-by-step procedure here.
A blog or web site contains different types of links like documents and media files. Apart from these, the site may contain links to external pages which you provide as references. For example, I have link to my Resume below by Profile section. How do I track how many people download my Resume? An instant answer is to set a goal with the specified target URL. But Analytics provide a better solution!
To track downloads of media files like PDF,Doc and others, you can make use of the method _trackVisit(). For example, lets say I want to track my Resume's download. I update my link as follows:
Now each download will be tracked as a visit to Resume_Download page. But our code update is not complete. We have some more modifications to make. If you look closely at the basic Analytics code, you will see that we are making use of pageTracker object and calling method like _initData. You need to add _trackVisit(),_setAllowLinker _trackTrans(). Another point to remember is to keep the Analytics code on top, may be the first thing in body tag.
That's not all, before we complete lets see how we can track java script events. For and example, if you click "About Me" from my top menu, I load a page using java script. To tract such event use can make use of the parameterized _trackVisit(). just like how we did in the previous case. But rather than calling it on the link, I call it in my java script functions. This way you can track even the Ajax requests. To track execution of a particular function all you have to do is add:
So now you have a better tracking of your blog or web site. I am still trying out these features and will bring out another update. But these days I get less time to do research. I will be soon releasing my blogger template for others to download as some of you have asked me. Plus, I have started to work on new template and this time it's going to be using Blogger API's. So watch out!