How to track jpg hits as page views in awstats 7.0
Asked Answered
A

1

6

I've setup awstats to read cloudfront log files and I need to be able to generate reports for hits on specific files, which are images used for banners. I changed "NotPageList" options to exclude the image files and I deleted the awstats*.txt data files and ran a fresh -update but the jpg images are still not counted as pages. What do I need to do to get this working?

LogFile="/var/log/cloudfront-logs/mydomain.log"
LogFormat="%time2 %cluster %bytesd %host %method %virtualname %url %code %referer %ua %query"
LogSeparator="\t"
SiteDomain="d2fxxxxxx.cloudfront.net"
HostAliases="d2fxxxxxx.cloudfront.net"
NotPageList="css js class bmp ico rss xml swf"
DecodeUA=1
Arrowworm answered 6/7, 2011 at 22:48 Comment(2)
For reference - I'm running 6.95-3.el5 (CentOS) - and the config above works for me. This is probably something new in 7 as indicated by @ArrowwormHagerman
See sourceforge.net/p/awstats/discussion/43428/thread/cf2a6f05 for a bug description.Overcautious
A
6

Looks like there is an additional criteria for a request to be a "page" determined by mime type in awstats which is not documented.. So, to fix this for my local install I hacked the code to remove this mime type test.

AWStats 7.0 build 1.971 awstats.pl line 18219

Before:

if ( $NotPageList{$extension} ||
($MimeHashLib{$extension}[1]) && $MimeHashLib{$extension}[1] ne 'p') { $PageBool = 0;}

After:

if ( $NotPageList{$extension} ) { $PageBool = 0;}
Arrowworm answered 7/7, 2011 at 3:9 Comment(1)
I was just struggling with the similar issue and was wondering why the changing the NotPageList configuration setting wasn't doing anything. The added OR (||) clause basically negates the helpful config setting in this case.Personage

© 2022 - 2024 — McMap. All rights reserved.