![]()
Wanting to track downloads of documents (PDF, Word, MP3 etc..) on your site with the splendid Google Analytics? You will be pleased to hear that it is very easy to achieve with a little addition to the link HTML, as shown below.
The code to add:
onClick="javascript: pageTracker._trackPageview('/files/google-analytics-test.pdf');"
Once added your full link should look a something a little like this:
<a href="http://www.realisingdesigns.com/files/google-analytics-test.pdf" target="_blank" title="Track my download" onClick="javascript: pageTracker._trackPageview('/files/google-analytics-test.pdf');">Test download code</a>
Giving you a link just like this - Test download code - nice and easy!
This will then show as a hit in your Google Analytics content section as if it were a URL. Very handy to monitor your site performance and iron out any creases with user experience.
Get social: