For my pdf, epub, and mobi download buttons I link to a “force download” php (readfile) script (hardcoded script, one for each file we deliver) which runs the file download. How nice it would be to have a stack to do this, complete with error checking and possibly even click counting (one count per ip address).
I know there are “bigger” “full blown” options… I’m asking for a simple button/script for this single application.
As for counting (reliably) how often a link is clicked, most RW users already include Google Analytics so it would be easy to create a new campaign and get the full details of how often a link is clicked. You could measure both unique downloads and returning visitors. And get specific details like what times of day files get downloaded the most etc.
It is probably overkill for what you need, but the Paperless stack does most of what you want, and a whole lot more. Good if you have lots of downloadable files to list: https://stacks4stacks.com/paperless/
Sadly, due to the nature of website/content, most of our visitors/business are users of old browsers.
I’m referring to error checking in the php script that downloads the file. My scripts to do the force download are 5 lines and there is no error checking. I basically set the read file name, out file name, and then do a php readme for the transfer. I do have to say though that we have hundreds of downloads a day on our free ebooks and I have virtually no support issues (file download errors.)
(I use Integrity by the way… but like I said… checking for broken links was not what i meant.)
I’ve used Google tracking for download clicks but I give up on them. I currently check my Clicky counts as Clicky tracks mobi and epub files automatically, unlike Google. But I find their counting to be suspect. I used to have hundreds of hand coded Google tracking links, complete with three "parameters’ (I forget what they are called) but then they just stop working one day with no explanation and I find out that Google has changed their tracking code requirements. I can’t go back and re-do hundreds of hand coded links.
I’ll absolutely check that out! I love your stacks and your business model and I know that I can always depend your stacks!
We sell lot’s of paid and free eBooks and with most being free, thus, development of the pages and downloads need to be fast and easy.
The perfect stack for me would consist of buttons/icons for pdf, mobi, and epub files with built in force downloads for all three. And built in ACCURATE click counting that requires no maintenance downstream.
Thanks Will. And thanks for your interest and help.
Will: That Paperless stack is fantastic! I don’t always need a table like it creates, but when I do … this is, by far, the easiest and best solution. Will be purchasing tomorrow. The demo really sold me on it.
I designed the DownloadLink icon to primarily to add a file specific Font Awesome icon to download links, but the stack also has an option to ‘force a download’. This is achieved by adding the download tag as mentioned by @willwood. According to Can I Use, this will work for some 80% of your visitors (iOS and Internet Explorer are the main party poopers).
For those who want better coverage than that: in the stacks’s documentation is an overview of what I consider the most practical other options to force a download.
@Mathew: a click counter is something I have not planned for this stack, sorry.
I realize now that epub and mobi are not recognised by the stack now. Unfortunately Font Awesome still has no specific icons for that. @1611mac: Would the book icon be an alternative?