After clicking on a link from search engine like Google website visitors arrive at the page that usually is called
landing page. In other words landing page is the first page that website users visit. And it is very important
to let them know what website has for them.
In this work we will consider how the content of landing page can be ajusted by specific interests of users. The perl script will be provided.
Motivation
Looking at the web analytics log for search results I noticed that some seach phrases have 0 time on site even if my site
has content for this search phrase. I looked at landing page and noticed that it does not exactly provide
link to content that user was searching. So the users don't see what they are looking on the first page and exit website
instead of researching it more. Thus I decided in addition to regular navigation to display links to content on my website
based on the search keywords from Google search engine.
The Problem
When the user visits a webpage there is a way to get the referring page and search keywords if it is visit form the search engine.
I built manually the page data file which has the following information:
link of pages on my site, text to display, keyword or tag associated.
The problem now is to match user search keywords with the link tags and select first 4 (or whatever number you want)
best matches. There are many different ways to do this. The easiest is to do just keyword match. It will be used
in this discussion.
The Script
Below is the link that does what was described above. The rank of links is based on the number of keyword matches.
The script looks in environment variable for HTTP_REFERER and if the visitor is from Google search engine the program
extracts search keyword phrase from referring url and then saves keywords in the array.
To extract keywords from url the script looks for text after &q= or ?q= up to the next & or the end of the string.
q is the name of the search parameter and for different search engines it can be different.
Then the program opens the file with the page data data.txt and counts number of matches for each query search.
Finally it shows top 4 units.
Conclusion
When the web visitor is coming from search engine the visitor interest can be described by searh keywords.
Therefore there is an opportunity to provide specific content or links to conent based on user interests.
The perl script for this task was implemented and described above. The link to this script is provided below.[1]