Does anyone use the Google Analytic? If so are you using their event tracking to capture PDF downloads?
OR
Does anyone have some suggestions how I can get this to work?
Basically to track PDF downloads with Google Analytic I need to add an onClick event to the URL. Most of my users however are using the RHythmyx inline link to link to their PDFs and I can’t see how to edit the bnFile template to include this onclick event, nor do I want to force all our users to use inline templates for their files.
We use Google Analytics to track ‘events’ such as a pdf download, or a click on an external link. We don’t use the trackPageview as we didn’t want it to affect our real pageviews. We use javascript to go find all of the links on page load and then once someone clicks on one we run an event to track them. We went with the javascript option so that it just worked for our end users and it required no modification on our end. It works pretty well, we haven’t had any real issues with it yet.
Thanks Ryan. Unfortunately a snippet template is what I’m trying to avoid as there are cases where we do need to use the inline link as opposed to template but thanks for the suggestion.
Thanks for the suggestion Alex. This javascript option, is it something you guys wrote yourself or was it something you found online and just had to modify it to work? Would you be willing to share the code?
We use the MooTools framework. So it is relatively easy to find all of the links. I used a combination of some code I had found somewhere, and then the suggestions in the Google Analytics FAQs.
This code should only fire if it finds pageTracker on the page so you should have to worry about clicks during preview, as I assume you don’t have your Google Analytics on your pages in preview anyway. If you are not familiar with JQuery or Mootools then this code might look a little foreign.