View Full Version : Get Keyword From Google

03-03-2008, 11:11 PM
Is their away to get the keyword someone used on google to find my site? Then once I get the keyword I will store it in a variable and display that variable on the site.

For example:
Person X searches google with the following keyword: "PHP Tutorials"
They see my site in the search listing and click on my link.
Now I want my site to store the keyword "PHP Tutorials" in a variable since this is the phrase they used on google. Once it is stored in a variable ill echo it onto my site as the main header.

I want to do this to increase relevancy and have better bounce rate.

Is it possible?

Thanks in advance :D

03-04-2008, 03:09 PM
Retrieve and parse the $_SERVER['HTTP_REFERER'] superglobal (http://uk3.php.net/manual/en/reserved.variables.php#reserved.variables.server). If the string contains "Google", then proceed to extract the keywords and process these for display (remove plus symbols, capitalise etc).

04-09-2009, 07:36 PM
Are you looking for this php class: