Personal tools
You are here: Home Documentation How-tos Track searches with AWStats
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Track searches with AWStats

This How-to applies to: Any version.
This How-to is intended for: Server Administrators, Site Administrators

The log analyzer AWStats is a free powerful and featureful tool that generates advanced server statistics graphically. Configure your Extra Sections to track what your users are looking for.

The AWStats ExtraSection features are powerfull setup options to allow you to add your own report not provided by default with AWStats. You can use it to build special reports.

Explanation on how to add/edit an Extra report in your config file
Take a look inside the AWStats config file to find the following part:

#-----------------------------------------------------------------------------
# EXTRA SECTIONS
#-----------------------------------------------------------------------------

Read all explanation in config file after this point, they will explain you how to add an Extra report by adding an ExtraSection configuration in your config file.

To track all searches add this section:

ExtraSectionName1="Plone Searches"
ExtraSectionCodeFilter1="200 304"
ExtraSectionCondition1="URL,\/search"
ExtraSectionFirstColumnTitle1="Search:"
ExtraSectionFirstColumnValues1="QUERY_STRING,SearchableText=([^&]+)"
ExtraSectionFirstColumnFormat1="%s"
ExtraSectionStatTypes1=PL
ExtraSectionAddAverageRow1=0
ExtraSectionAddSumRow1=1
MaxNbOfExtra1=100
MinHitExtra1=2
If you have the Google Co-op Product installed you may track the searches like this:
ExtraSectionName2="coop searches"
ExtraSectionCodeFilter2="200 304"
ExtraSectionCondition2="URL,\/googlecoop"
ExtraSectionFirstColumnTitle2="Search"
ExtraSectionFirstColumnValues2="QUERY_STRING,q=([^&]+)"
ExtraSectionFirstColumnFormat2="%s"
ExtraSectionStatTypes2=PL
ExtraSectionAddAverageRow2=0
ExtraSectionAddSumRow2=2
MaxNbOfExtra2=200
MinHitExtra2=2
Note that you have to alter the names ExtraSectionXXXX1 to ExtraSectionXXX2 (and so on) for each Extra Section you add.

by Christian Ledermann last modified February 12, 2007 - 13:19 All content is copyright Plone Foundation and the individual contributors.

Very cool....

Posted by Tannic at February 15, 2007 - 15:40
I added it to my awstats.domain.com.conf and it worked like a charm.

Is there a way you can track Live Searches as well?

BZ

An improvement for LiveSearch and elimination of search spam

Posted by Darryl Dixon at August 29, 2007 - 05:48
Hi, this is a great recipe, but can be improved somewhat by including searches performed via LiveSearch, and setting the ExtraSectionCondition up to eliminate 'search spam' from the tracked results (by 'search spam' I mean submissions to the search form that include '<a href=...' style data - usually a sure sign of a bot spamming the form). Finally, I think it makes sense to show searches even if they're only performed once, hence the alteration to the last line.

The improved version looks like this:

# Track Plone searches:
ExtraSectionName1="Plone Searches"
ExtraSectionCodeFilter1="200 304"
ExtraSectionCondition1="URLWITHQUERY,\/search(?!.*%3Ca[+]href)||URLWITHQUERY,\/livesearch_reply(?!.*%3Ca%20href)"
ExtraSectionFirstColumnTitle1="Search:"
ExtraSectionFirstColumnValues1="QUERY_STRING,SearchableText=([^&]+)||QUERY_STRING,q=([^&]+)"
ExtraSectionFirstColumnFormat1="%s"
ExtraSectionStatTypes1=PL
ExtraSectionAddAverageRow1=0
ExtraSectionAddSumRow1=1
MaxNbOfExtra1=100
MinHitExtra1=1


regards,

Darryl Dixon

Winterhouse Consulting Ltd

http://www.winterhouseconsulting.com

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by