Download statistics for WordPress site?

I solved the problem, and the download statistics now works in Google Analytics.

Using the plugin mentioned above, download statistics are readily available, but it didn’t work out for me until now. This was because I had made all the links for downloadable files on my site with relative paths – for instance with

<a href="https://wordpress.stackexchange.com/documents/document1.pdf" target="_blank">File</a>

for a file document1.pdf, located in the documents folder. This allowed me to download the files from the site, but they wouldn’t occur in the Google Analytics events this way. For this to happen, I had to specify absolute paths – in the above case this would be:

<a href="www.mydomain.com/documents/document1.pdf" target="_blank">File</a>

And then the file downloads occur in the Google Analytics statistics.

Alternatively, following the procedure from this site, it is possible to break all links and file downloads down even more than the above will do by coding each link as follows:

<a href="www.mydomain.com/documents/document1.pdf" onClick="_gaq.push(['_trackEvent', 'File download', 'document1.pdf', 'Link on specific page']);">File</a>

This will give specific information about download of the document from the specific page where the link is put (which, of course, is only useful if more links on the site lead to this same file).

Anyway, I’m sticking with the first solution for now since the manual coding of each file link is avoided. But I can definitely see the idea in the more detailed information that the second method will provide.