Thursday, December 01, 2005

Like many others I am trying Google Analytics.  I first heard of the JavaScript tracking technique with LiveStats 7.  One feature that kept me from liking the technique they use for tracking is that it is difficult to track file downloads.  I work with a lot of content management systems that would require quite a bit of modification to add the required scripts to file download links.  However, the information you can get from this tracking technique is otherwise far superior to anything you can ever get from  traditional log analysis.  Ideally I would like to dynamically add the tracking code to all download links in my content.  The 2 ideas floating in my head at the moment are:

#1  Add an ISAPI filter in IIS that would parse all output and add the tracking code to any download links that match RegEx patterns.  Perhaps all PDF download links for example.

#2  If possible, use JavaScript injected in the content pages to dynamically add events like onClick to elements like the anchor tag.  I already have to inject the tracker scripts so it would be great if I could inject a page parser script as well. 

Anyone have other ideas or thoughts on the possibility of these options?  I don't do ISAPI so #1 is out for me unless I can hire it out.