Welcome to WebmasterWorld Guest from 54.159.240.93

Forum Moderators: open

Keywords

keyword referrals

   
5:22 pm on Oct 31, 2010 (gmt 0)



Is the keyword a user uses to find a web site through a search engine accessible in any way?

In my site statistics, there is a list of keywords that users have used to find my site through varous search engines so obviously the keywords are getting passed to the server. I was just wondering if they were accessible in some kind of variable? I use php.

Im thinking along the lines of if a user visits my page using keyword 'blue widgets' then a blue widget image is displayed, if the keyword they use is 'red widgets' then a red widget image is displayed instead, is this possible?

TIA
10:44 am on Nov 3, 2010 (gmt 0)



Hi shadowlight, you certainly can access this information. The URL of the user's previous page is contained in the $_SERVER['HTTP_REFERER'] predefined variable [php.net].

You then need to extract the keyword from the search engine's URL, e.g. for Google:

[google.co.uk...]

You can use various methods to grab this info - one would be to split the string based on the question mark and & symbols (if they exist) or you could use a regular expression.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month