Since most Matrix files are served by apache, it is not as easy to log those downloads with Google Analytics. So, I wrote a little jQuery to bind click events to any links that look like files. Just make sure to add the Google tracking code above where you place this code:
$("a[href*='.pdf'], a[href*='.doc'], a[href*='.xls'], a[href*='.ppt']").click(function() { pageTracker._trackPageview('/doc/' + $(this).attr('href')); }); $("a[href*='.mov']").click(function() { pageTracker._trackPageview('/video/' + $(this).attr('href')); }); $("a[href*='.zip']").click(function() { pageTracker._trackPageview('/file/' + $(this).attr('href')); }); $("a[href*='.mp3']").click(function() { pageTracker._trackPageview('/audio/' + $(this).attr('href')); });
Now, since we have added the file type to the data we send to Google, we just go to Google Analytics, click "Content", then "Top Content", and enter the file type to search for, such as /doc or /audio and it should find all the Matrix files that were downloaded, and their stats.
Don't forget the standard jQuery ready function. :)