Hits on Images
AWStats reports include a standard list of hits on the web site pages. The web site pages are all URL’s ending with .htm, .html, .php, .asp,… Images and multimedia contents are not pages.
If images are important in your web site, you need to know which images are the most shown.
This extra section lists the most popular images of your web site.
You can add the Extra Section below at the end of your awstats.your-domain-name.conf configuration file.
New Report

This AWStats screen has been simulated for better readability.
Extra Section
ExtraSectionName1="Hits on Images"
ExtraSectionCodeFilter1="200 304"
ExtraSectionCondition1="URL,\.(png|gif|jpe?g)$"
ExtraSectionFirstColumnTitle1="Image"
ExtraSectionFirstColumnValues1="URL,^(\/.*\.(png|gif|jpe?g))$"
ExtraSectionFirstColumnFormat1="<A HREF='http://www.your_site.com%s' TARGET='_blank'>%s</A>"
ExtraSectionStatTypes1=HBL
ExtraSectionAddSumRow1=1
MaxNbOfExtra1=10
MinHitExtra1=1
Replace www.your_site.com by the address of your site.
MaxNbOfExtra1 is the number of lines that will be listed. Use the most convenient value.


March 20th, 2007 at 7:07 pm
I added that extra section in my awstats.your-domain-name.conf but I dont get any data on the reports… the new fields are shown in the stats but they are all empty… all other normal fields of awstats updates normally.
Do I have to chenge something on the Apache logs or what?
Thanks a lot and this is a very usefull site
congratulations!
March 20th, 2007 at 9:30 pm
I copied the section in an AWStats config file and I got the same result as you! This was caused by WordPress replacing my " (quotation mark) by ” (right double quotation mark) and my ' (apostrophe) by ‘ (left single quotation mark).
I have found a work-around and I just updated the extra section accordingly. You should now be able to copy it and paste it in your AWStats config file without problem.
March 21st, 2007 at 2:36 pm
Thanks a lot for your answer!! that little detail solved my problems… now it works!
Thanks again!
October 6th, 2007 at 10:07 am
Hi there. I’ve noticed that your ExtraSection config parses ALL images on the server. This is including those which AWstats uses as icons to display for its statistics.
(Im a total noob when it comes to regexp)
Is there an easy way to restrict the image statistics to a specific subdirectory (include all subdirectories benath it)?
e.g./var/www/example.com/images/
and this would include all subdirectories such as:
/var/www/example.com/images/old/
/var/www/example.com/images/new/
/var/www/example.com/images/photshopped/
October 6th, 2007 at 10:19 am
Try this:
ExtraSectionFirstColumnValues1=”URL,^(\/images\/.*\.(png|gif|jpe?g))$”
It will only count the images under /images.
October 31st, 2007 at 1:29 pm
Hi Jean-Luc, I am trying to add to my ExtraSection a filter that contain only mp3 download files, but I cant.
the url that appear in my log is like this:
GET /download.php?archivo=file.mp3
I just added the URLWithQuery=1 in my cfg file, but nothing appear in my extra section
How can I do it?
Thanks
October 31st, 2007 at 1:44 pm
You need to use URLWITHQUERY in the extra section:
ExtraSectionCondition1=”URLWITHQUERY,^\/download\.php\?archivo\=\w+\.mp3$”
…
ExtraSectionFirstColumnValues1=”URLWITHQUERY,^\/download\.php\?archivo\=(\w+)\.mp3$”