In awstats I get a table with all the key words and phrases used to find my website. I would like to capture this myself however each search engine url is in a different format
One possibility is to just grab the referring URL ($_SERVER['HTTP_REFERER']
) and parse out the keywords in it.
For example, check out this Google URL (searching for "stack overflow"):
http://www.google.com/search?hl=en&q=stack+overflow&aq=0&oq=stack+over&aqi=g10
The value of the q
GET variable holds the keywords delimited by + signs.