Skip to Navigation | Skip to Content

Search Analytics for your Site

Conversations with your Customers

Title in Progress

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.

We're also looking for versions of this script in other languages, such as Python, Ruby, and Visual Basic. If you'd like to code this script in another language and share it, we'll be more than happy to host it here and fully attribute your great work.

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.

It would be useful - for those of us who aren't strong in perl - to provide an example input file so we can see the log format the script is anticipating.

For that matter, it would also be useful to see an example of the output of this script.

If this script looks like it will work with my query log files (ultraseek) and the output is what I'm after then I'll make the effort to install PERL. But I don't want to do this only to find its not what I'm after.

Having access to some basic scripts would be really useful for us.

Cheers
Charlie.

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)