GetSimple Support Forum

Full Version: Need to track downloads from my site -- how?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to track downloads of a particular file posted on my site. I have the google analytics plugin, but it doesn't track the downloads. Help!

I need to get this up and running quickly.
You can never know for sure that the user has downloaded a file without any issues.

Maybe you will need to force the file download with PHP using header(), something like this:

Code:
...
header("Content-Type: $type");
header("Content-Transfer-Encoding: Binary");
header("Content-Length:".filesize($location));
header("Content-Disposition: attachment; filename=\"$file\"");
readfile($location);
...
    
And what you can do is to implement an additional step that must be executed after the file is successfully downloaded then you can track that step.
Perhaps with the Hitcount and Download Interceptor plugins...
(2016-10-28, 03:18:27)Thanks, but I don\t need to know about successful downloads, just attempts. Bigin Wrote: [ -> ]You can never know for sure that the user has downloaded a file without any issues.

Maybe you will need to force the file download with PHP using header(), something like this:


Code:
...
header("Content-Type: $type");
header("Content-Transfer-Encoding: Binary");
header("Content-Length:".filesize($location));
header("Content-Disposition: attachment; filename=\"$file\"");
readfile($location);
...
    
And what you can do is to implement an additional step that must be executed after the file is successfully downloaded then you can track that step.
More infos
How to Track Downloads in Google Analytics:
http://www.blastam.com/blog/how-to-track...-analytics

I didn't know the plugins that Carlos mentioned before, but if you are familiar with PHP see here the second Answer:
http://stackoverflow.com/questions/12295...oad-script

Or you can try this script: 
https://github.com/iNamik/PHP-Download-Tracker