GetSimple Support Forum
Need to track downloads from my site -- how? - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Need to track downloads from my site -- how? (/showthread.php?tid=8799)



Need to track downloads from my site -- how? - sfsinger - 2016-10-28

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.


RE: Need to track downloads from my site -- how? - Bigin - 2016-10-28

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.


RE: Need to track downloads from my site -- how? - Carlos - 2016-10-28

Perhaps with the Hitcount and Download Interceptor plugins...


RE: Need to track downloads from my site -- how? - sfsinger - 2016-10-28

(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.



RE: Need to track downloads from my site -- how? - Bigin - 2016-10-28

More infos
How to Track Downloads in Google Analytics:
http://www.blastam.com/blog/how-to-track-downloads-in-google-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/12295604/php-simple-download-script

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


RE: Need to track downloads from my site -- how? - datiswous - 2016-10-28

http://get-simple.info/extend/plugin/piwik-integration/920/
http://get-simple.info/extend/plugin/google-universal-analytics/749/

I didn't test those