I have a document library in which my client would like to see how many times a document has been downloaded. Is there a way to see how many hits the PDF in the Doc lib has - through usage or stats? I have Google Analytics installed on the Site collection but I couldn't drill down for enough to find these statistics.


You could use the auditing feature as suggested in the comment, however the auditing files need to be purged at regular intervals and this will not work for long periods of time.

You could use Google Analytics for this, but it is not as straightforward as we would wish.

To monitor a link, you add something like the following

<a href="pathtoyourfile" onclick="var that=this;_gaq.push(['_trackEvent','Download','FILE',this.href]);setTimeout(function(){location.href=that.href;},200);return false;">FILE</a>

The problem is that you will need to modify the links on your library, which can be accomplished with several different ways, one of which is jquery (run through the links and change them).

Client-side rendering (JS Link) is another option.

  • Very interesting that you can track single clicks. What section would it show up under Google Analytics? – Michael Colbs Oct 1 '14 at 14:46
  • You will find all necessary information on Google Analytics website. You can start at support.google.com/analytics/answer/1136922?hl=en I really haven't used this, but it should be pretty straightforward to set-up and monitor. – yandr Oct 2 '14 at 5:18
  • 1
    Google Analytics wouldn't account for WebDAV browsing (aka Explorer view) or opening the file directly from Office application. Only built-in auditing and custom IISW3C log parsing (on all front-ends or in the WSS_Usage database) would. – Alexey Krasheninnikov Nov 5 '14 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.