Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Textpattern's file download count or AWStats?
Hi!
I recently launched a site for a non-profit for whom file downloads is a key statistic it uses to report to its donors. I pointed out that the list of files under the “Files” tab in Textpattern can be sorted by download count, and the host server has AWStats running.
The problem is that Textpattern’s file download counts do not agree with those AWStats. I can’t account for the discrepancy, and I’m not sure which number is more accurate.
For instance, Textpattern shows 429 downloads for File ID 11. AWStats shows 100 for January, 165 for December, and 1 for November, which is when the file went online— a total of 266 downloads. That’s 62% of the Textpattern total.
File ID shows 374 downloads in Textpattern. AWStats shows 71 for January, and 88 for December (none for November)— totaling 159. That’s 43% of Textpattern’s total.
- Can anyone explain why AWStats and Textpattern have different numbers for the same file?
- Is there a way to assess which count is more accurate?
Thanks!
Offline
Re: Textpattern's file download count or AWStats?
That’s a huge discrepancy. I’m only guessing because I don’t know AWStats, but could it be that they are filtering out hits from robots?
Code is topiary
Offline
Re: Textpattern's file download count or AWStats?
In addition to what jsoo suggested (which can probably be kept in check with some choice entries in a robots.txt file) AWStats probably filters out duplicate downloads from the same IP address. In TXP, I believe a hit is a hit regardless where it came from. And it even counts a) your own downloads while testing, b) downloads that are clicked and cancelled (though it’s supposed to anul the latter, I don’t think it works on some hosts — someone might prove me wrong).
At the risk of being anti-TXP I’d say the AWStats are probably more accurate BUT I think it can backfire if you have people accessing your site from large corporations that share an Internet connection and thus have a single IP for the whole company; they might only count as one download.
How about using (TXP count + AWStats count) / 2))
:o]
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Textpattern's file download count or AWStats?
Thank you Jeff, Stef! The foregoing makes a lot of sense. I can get specifics about the AWStats setup from the hosting provider. Cheers!
Offline
Re: Textpattern's file download count or AWStats?
Hello! I wonder how to make sense of this today.
Based on the server logs, AWStats now says that a certain file got 5,457 in 2024. Textpattern logged 499 for that file during the same period.
Does Textpattern filter hits at all, as of v4.7.3?
Offline
Re: Textpattern's file download count or AWStats?
Do the PDF files show independently in a Google search? (search for site:domain.com ext:pdf
as you probably know). That might explain why AWStats shows different results to those logged by txp.
EDIT: To expand on that, my understanding is that Textpattern only counts downloads via the /file_download/123/filename.pdf
link. Any direct link to /files/filename.pdf
is not counted by txp, but this will be logged as a file access on the server.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Textpattern's file download count or AWStats?
I suspect that the txp counts are mainly people, while the awstats counts are mainly robots. What statistic do you want?
/files
should be disallowed in robots.txt
. That will help a bit with bots. Assuming Apache, Options -Indexes
in .htaccess
will prevent folder search, which will also help with bots. You could even disallow /files
in .htaccess
.
Last edited by skewray (2025-01-25 16:25:22)
Offline