![]() |
| Home | Demo | Services | Features | Help | User Forum | Blog | About | |
|
#1
|
|||
|
|||
|
Hello everybody,
I recently found that direct download links aren't counted. Example : I give a friend a direct link to a file stored on my website. I want it to be counted in StatCounter, but it's not. Obviously, it's because there is no script loaded between the click and the download. So I thought that I could write a PHP script, like /download.php?file=example.png (which includes statcounter script) and that redirects on the file. Do you think this is a gonna work, or will it just count as a view for download.php ? Of course, i can name the title of the page according to file's name but that's not exactly what I want. Thank you. |
|
#2
|
||||
|
||||
|
Quote:
Your solution should work, if the page /download.php has the counter code and is loaded before the redirect. With not much more than the counter on the page it does not need much delay before redirecting. And a simple "meta refresh" tag in the header of the download.php (or html) file will do. To redirect to the file, the syntax is nearly the same as reloading the current page: <meta http-equiv="refresh" content="2; url=example.png/"> The "2" for content is the time in seconds before it redirects. |
![]() |
| Tags |
| direct, download, links, stats |
| Thread Tools | |
| Display Modes | |
|
|