Tying Searches to Individual Web Pages
Knowing what search phrases visitors typed to drive traffic to your website is essential. It’s even more important to tie the search phrases back to the actual web pages. Some of the available web stats tools on shared hosting providers do not show this sort of relationship.
You can tie searches to individual web pages with a simple Perl script: searchPhraseReportGoogle.pl, which appears in full in Appendix A. This script can handle multiple logfiles. To run the script, type in the following:
perl searchPhraseReportGoogle.pl logfile1.log logfile2.log
The assumption is that the logfiles are stored in the NCSA Combined format. After you run the command, a file called keywordsummary.html is generated. If you open the file in a web browser, it should render similarly to Figure 6-16.

Figure 6-16. Keyword summary page for Google
As you can see in Figure 6-16, you can clearly see which page or file got the most hits for a particular keyword. The forward slash (/) indicates the default page for this domain. You should have no doubts about where the hits are going and for what keywords.
You can modify the preceding Perl script to do the same thing for Bing searches. The modified version, searchPhraseReportBing.pl, is also available in Appendix A. To run it, execute the following command:
perl searchPhraseReportBing.pl logfile1.log logfile2.log
Simply list filenames ...