Skip to Main Content
SEO Warrior
book

SEO Warrior

by John I Jerkovic
November 2009
Beginner content levelBeginner
496 pages
13h 46m
English
O'Reilly Media, Inc.
Content preview from SEO Warrior

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.

Keyword summary page for Google

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The SEO Battlefield

The SEO Battlefield

Anne Ahola Ward

Publisher Resources

ISBN: 9780596804749Errata Page