Skip to Navigation | Skip to Content

Search Analytics for Your Site

Conversations with Your Customers

Search Analytics

Sample Code/Templates

This simple and free PERL script (5Kb download) reads your Web search engine's log and produces a report listing your most popular search phrases in rank order. You will need to gain access to the log or a copy of it. Run this script with the log as your input, and the report will be your output. You may need to tweak the script a bit depending on the idosyncracies of your search engine's log format. A number of institutions have run this script as a low-overhead way to gain basic insight into search patterns. You might want to run the script periodically--say, once a month. With the help of your server administrator, you might be able to automate periodic running of this report.

And you might like to use this gently customized Microsoft Excel spreadsheet template to analyze your own query data. You'll need to paste in two columns: queries and query counts. The formulae should take care of the rest...

Comments

the loganalyzer script wouldn't run until i removed the "numerically" and "logdatewise" words after the sort keywords in lines 81 & 93.

otherwise perl would give an error message:
Undefined subroutine in sort at ./loganalyzer.pl line 81, line 7283.

$ ./loganalyzer.pl

Number of queries with n search terms:
Illegal division by zero at ./loganalyzer.pl line 87, line 1475.

Post a comment

We’ve enabled comment moderation on Rosenfeld Media. Upon posting your comment, it will not immediately appear on this page. Hang tight, we’ll be sure to screen it before too long. (Starred fields are required)

We don’t like these either (but comment spam makes them a must)

Buy This Book:

Ordering, Shipping & Return Info