0

I have a Wordpress site and would like to track the basic statistics for the site; visitor numbers, visitor numbers for specific pages on the site, download statistics etc. For that purpose, I have installed the "Google Analytics for Wordpress"-plugin (http://wordpress.org/extend/plugins/google-analytics-for-wordpress/), and this now tracks much of the information that I want via Google Analytics.

However, the download statistics don't work as I want it to: It only tracks files that have been uploaded via the Wordpress Dashboard and that go into the default upload folders (e.g. .../wp-content/uploads/2013/04). I have my files for download in custom folders (e.g. in .../documents), but these are not tracked by Google Analytics with the above plugin.

I have looked into setting this up manually in Google Analytics, but to be honest I don't quite understand how to do this. Alternatively, a Wordpress plugin that tracks the downloads of files from custom folders would work for me. There are a number of plugins for this purpose (e.g. http://wordpress.org/extend/plugins/simple-download-monitor/), but it is not clear to me if they are still maintained and are reliable.

So what simple and reliable solution would you recommend for download statistics from custom folders on a Wordpress site?

Thanks in advance for any help!

  • 2
    You have made three questions at once here - how to track directly uploaded files with GA plugin, if another plugin is maintained and to recommend you any plugin. Two latter are (2) close to and (3) explicitly off topic as per FAQ. I would advise you to edit question and focus on first one, otherwise this will likely get closed as off topic. – Rarst Apr 12 '13 at 11:44
  • @Rarst: Thanks for your feedback. I only ask one question, namely how to track download statistics in Wordpress. The part about GA and other plugins is only given as background, and as evidence that I have tried to find a solution before posting anything here; they are not questions. I can rephrase the question if desired, but there really only is one question. Cf. the FAQ, I am a site administrator that has a question about management best practice (concerning best practice for Wordpress statistics). – user15272 Apr 12 '13 at 12:04
  • 1
    Note that FAQ explicitly says "asking for recommendations for plugins" is out of scope for the site. My recommendation above stands - if you would focus question on how to tweak or extend specific solution it might make good question, but asking for generic recommendation will just get question closed. – Rarst Apr 12 '13 at 12:28
  • 1
    You can implement it quite easily using GA's event tracking. That is, of course, if in your HTML you have some sort of a special CSS class or ID on every link that you want to track. – montrealist Apr 12 '13 at 13:16
0

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="/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.

| improve this answer | |

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.