This will be easy for someone who knows PHP.
My intent is to build a database of search queries for each page of my website.
I need to be able to pull the search strings a website visitor used on a search engine that brought visitors to my site.
project scope:
Write a PHP code segment that I will include (include "[login to view URL]";) in each of my web pages.
From there I want to be able to print the search phrase that the user entered into the search engine.
example: print "$query";
Also, since I will be building a database of search engine queries for each of my landing pages, I need to know the landing page of the query.
Example: print "$landing_page"; would show the page that the user landed on when sent by the search engine.
I would also like to know the search engine that sent the user to my site so I can also print it.
example: print "$search_engine<br>"; will print Google, Bing or Yahoo.
I am only interested in tracking the following search engines:
[login to view URL]
[login to view URL]
[login to view URL]
All other search engines can be ignored.
You will not need to worry about the database. I will take care of that.
A successful project will allow me to enter the following code in each of my pages:
<?php include "[login to view URL]";
print "$query<br>";
print "$search_engine<br>";
print "$landing_page<br>";
?>
The results then would look like:
ask uncle ralph
[login to view URL]
[login to view URL]