I need some help. Please help me to get
1. Which keyword is searched from the google for my site
2. Which time it is searched?
3. Referrer URL
4. The link redirects to which page url of my site.
I think that is only possible from your site and it is easier to write the code if your site has single entry. If I am not wrong, you can get three of those data from the HTTP referrer which is available in $_SERVER in PHP. So try:
echo $_SERVER["HTTP_REFERER"];
and see what it will print. It will have the whole URL that was in the browser’s address bar after someone searches with some keywords.
But for the time I think you have to track it when they enter into your site. So it will be your the time of your server not directly from the google when they searched.
I am not sure if there are other ways to track that. Would be great if there are some other ways too.
Remember priya, in the code that Steve has provided, the time is the time of your server when the user enters into your website but not the time of search in google. Lets suppose one searches in Google at 10am and clicked the link after 30 minutes then the time will be of 10:30am not 10am. Hope it is clear.
You can’t obtain url after hash # via HTTP_REFERER.
Google search changed to ajax, and its url are now unreadable.
after # is generated by javascript (only on client side), and only this way you can obtain it. Mabe Google sends their parameters by POST now, I don’t know anything about it.