How to Track PDF – Videos & Other Files in Google analytic

How to track PDF files Videos and other downloadable files with Google Analytics

Sometimes we needs detail how many people downloaded a particular video, pdf file, music file or any other downloadable file. Now this is possible in google Analytics. Earlier there was not possible as there was no tracking code available on the pdf and other downloadable documents. Now with the help of new google analytics we can track all these details also.

There is a function called “_trackPageview()” in google analytics that you need to tag for every document that you want to track. Let understand it with a good example

If you have a downloadable pdf document called “citimap”, which is linked on page “/travel-map/”, Then you need to code like this

< a href="http://www.yourdomain.com/travel-map/map1.pdf" onClick="javascript: pageTracker._trackPageview('/downloads/citimap'); ">Download< /a>




Similarity for other videos and music files you can tag it with (‘/download/avi1’) or (‘/download/video1’) etc.



For those who are still using old Google Analytics code:

< a href="http://www.mydomain.com/travel-map/citimap.pdf" onClick="javascript:urchinTracker ('/downloads/citimap'); ">Download



You can track your data within 24-48 hours, Google Analytics code must be present on that page otherwise mere placing the function will not work.


How to make sure whether you are using old Google Analytics or the New One. It is very simple just you need to search for

< script type="text/javascript" >
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

< script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();


For old Google Analytic the function is:

< script type="text/javascript" src=" http://www.google-analytics.com/urchin.js ">
< script type="text/javascript">
_uacct = "UA-xxxxxx-x"
urchinTracker();

To view the source of your page you can click CTL+U in case of firefox,

For internet Explorer click on view source in the toolbar

And for chrome its Click Developer - View Source

This method of tracking pdf, avi files, videos, music files etc will increase your total page views whenever user click and download the stuff but actual user is just downloading a file, playing music, videos and not visiting a page. If you don’t want to increase your page views then you can use event tracking for these files. What you need to do
< a href="download/product.pdf" target="_blank" onClick="pageTracker._trackEvent("PDF Files", "Downloads", "product details", "1");">Product Details Download
This method contains four new metrics: Categories, Actions, Labels (optional), and Values (optional)
Now this method will not increase your page views and will act as a Goal. You can easily access the data using event in your Google Analytic.

Enjoy Google Analytic - The best Web Analytic software available

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • Fark
  • Furl
  • Propeller
  • Reddit
  • Simpy
  • StumbleUpon
  • Technorati
  • Yahoo! Buzz

Related posts:

  1. Google Analytic Filters Guide How to Create Google Analytic Filters Filters in Google Analytic are a great...
  2. Google Analytics Intelligence Feature Google Intelligence: It’s a new feature in Google Analytics: Its...
  3. Link Your Adsense Account with Google Analytics Another Feature for user to Increase earning from the website...
  4. Why should You Go for Gmail as free Email AC Why should you go for Gmail as free email AC?...
  5. Top Ranking Without SEO in Few Seconds in Google No SEO – Top Ranking in Few Seconds – Funny...

This entry was posted in Tech News and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>