View Full Version : How to track downloads and PDF files?
awaresoft
11-01-2004, 08:37 PM
Is there a way to track downloads and PDF files?
Thinking out loud: Would I need to create a seperate web page for each download and PDF I wanted to track, add the StatCounter code to these pages, and then have these pages immediately redirect (via meta tag?) to their original content (download or PDF)?
I'm not sure what the drawbacks of this approach would be. In addition to having to create and maintain extra HTML stat/redirect pages, the redirection process certainly wouldn't be that great a user experience. And there may be browser compatibility issues as well.
Hopefully there's a better way :)
If anyone has sample HTML redirect code to implement this design that would also be appreciated.
Thank you!
Malcolm
bradrourke
11-07-2004, 01:10 PM
I have a few pdf's on my site, and I also like to track when people leave my site. So, I have a redirect page that uses a meta-refresh to send the person to the requested location. Here is what I have learned:
1) Give the refresh a long lead time (like 10 seconds) becuase most people use their "back" button when they want to leave a pdf...if the refresh is immediate they can never move "back" past your redirect page;
2) The redirect page should have language explaining what is happening, along with a link to click to hurry the process;
3) The initial link should open a new window, the refresh url should open within this new window. That way, if everything goes pear-shaped the user can just close the window.
Here is a redirect page I use:
http://www.bradrourke.com/r/csm_05-18-2004_pdf.html
Hope this helps.
--Brad Rourke
awaresoft
11-08-2004, 11:19 PM
Brad!
Thanks for the tips. The only drawback I can see to the redirect is that there's no way to measure who actually opened your PDF's vs. arrived at the redirect page and canceled.
Malcolm
PS: I also enjoyed your writing. :)
bradrourke
11-08-2004, 11:37 PM
Malcolm--
Thanks for the nice note.
I haven't figured out a way to track the pdf downloads vs. cancels. I do worry that the redirect wait is too long, but I am balancing that with the ability to "back" without getting bumped immediately forward again to the pdf. Before I figured that out, I noticed lots of visitors getting into these back-and-forth sequences (like four or five at iterations at a stretch) which I can only guess is irritating to a user!
I could inspect the webserver log, but I can only get aggregate data by that method, rather than the granular info I can get thru Statcounter. If you come up with an idea, let me know!!
Thanks,
--Brad
awaresoft
11-09-2004, 12:44 AM
Brad,
I think your 10 second delay is perfect from a usability standpoint.
Idea 1: Very strawman - might be to use Javascript to provide a loader type animation sequence that you frequently see with some Flash animations. So instead of arriving on a static web page one would see somthing like a "Loading 10% ... 100%" type of progress bar?
Idea 2: Use frames or iframes to force the html code to load simultaneous with the download.
Malcolm
This is what I want to do also... but you guys are a little too technical for me. Can a "click" on a link be tracked? wouldnt that solve the problem? If you want to know who opened a Pdf then if the "click" could be tracked you would know.
webado
11-09-2004, 02:17 PM
This is what I want to do also... but you guys are a little too technical for me. Can a "click" on a link be tracked? wouldnt that solve the problem? If you want to know who opened a Pdf then if the "click" could be tracked you would know.
It can, but you have to add an onClick event handler to the link, and then define that event handler in the <head> in a javascript. Statcounter code doesn't work (well) if placed in the <head>, but with some creativity you can get it to work acceptably. All this would only work with javascript enabled though. I started working on this myself and kind of got bored :lol: Maybe I should resurrect it.
awaresoft
11-09-2004, 08:36 PM
Christina,
I would love to see what you've come up with regarding your onClick event handler.
I believe an onClick event handler might be better than a frame approach. My problem with a frame approach is that it might mess up a site's natural interface?
I think that an iframe approach may have some merit but don't know enough DHTML to come up with a solution.
Thank you! (Merci Madame)
Malcolm
webado
11-09-2004, 09:03 PM
Christina,
I would love to see what you've come up with regarding your onClick event handler.
I believe an onClick event handler might be better than a frame approach. My problem with a frame approach is that it might mess up a site's natural interface?
I think that an iframe approach may have some merit but don't know enough DHTML to come up with a solution.
Thank you! (Merci Madame)
Malcolm
OK, tonight when I get home and have time to look for all the dead bodies :lol:
webado
11-10-2004, 01:47 AM
OK, I dug up my old tests and cleaned them up a bit and here's what I came up with: http://widget.webado.com/download-tracking/download-tracking.html .
My headache right now is that precisely the pdf example page does not work in Mozilla Firefox despite my getting umpteen plugins for Acrobat Reader. It works in IE, so that's good enough for me right now. If I'd forgotten why I hated Firefox, here's why :evil:
In my examples for now I'm showing a WMV video, a photo and a PDF file. I'll be trying to embed other file types and see what happens, nothing to lose but some more time :lol:
They all work the same way. Each is set on a separate html page which contains the counter code and each such page is opened in a pop-up window by a onClick event handler.
The drawback of course is that you have to make a page for every item you want to track in this manner. Perhaps by using dynamically generated code it can be done in one php script with input parameters, but this hasn't quite simmered down from idea to actual code yet. This is why I'd set it all aside way back when and forgot all about it until you all brought it up again.
awaresoft
11-10-2004, 02:40 AM
Christina,
Your examples worked great (tested using IE 6).
Would be great if StatCounter added some native mode feature to do this across browsers.
Malcolm
webado
11-10-2004, 02:53 AM
Christina,
Your examples worked great (tested using IE 6).
Would be great if StatCounter added some native mode feature to do this across browsers.
Malcolm
What do you mean "native mode feature" :?:
I wasn't having problems with the Statcounter part, but rather with embedding a pdf file in a web page and rendering it in Firefox ( :evil: ). Statcounter counts it ok regardless of browser.
awaresoft
11-10-2004, 03:07 AM
Christina,
> I wasn't having problems with the Statcounter part, but rather with embedding a pdf file in a web page
I missed that nuance. :oops:
Thanks again!
Malcolm
webado
11-10-2004, 03:42 AM
Christina,
> I wasn't having problems with the Statcounter part, but rather with embedding a pdf file in a web page
I missed that nuance. :oops:
Thanks again!
Malcolm
LOL, Malcolm! Could you tell how much I hate Firefox? :lol:
bradrourke
11-18-2004, 01:41 AM
This is very cool and helpful. But, why use the onClick, when a simple link would do? It seems to me that Statcounter works on the pdf page because of using embedding...
Well done. :)
--Brad
webado
11-18-2004, 04:33 AM
This is very cool and helpful. But, why use the onClick, when a simple link would do? It seems to me that Statcounter works on the pdf page because of using embedding...
Well done. :)
--Brad
The counter has to be executed at some point where you know the file is imminently about to be downloaded or otherwise opened.
If you think you can embed javascript in a PDF document itself, try it. I don't know how to do this if it's possible at all. I strongly doubt it.
---- much later ----
Of course with the onClick even handler, the technique can be used to track the linking to other pages that don't have the counter on them, like from other sites - this will require some further adjustements however which I haven't completely worked out yet.
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.