I need to get the keyword what user's searched in the google search engine. I tried http_referer in php but got only the origin not the full url and keyword. Kindly share some idea about.



Unfortunately, you can't. I've looked into this in the past.

HTTP_Referer is only compatible with http addresses. Https addresses do not pass referer data because they are httpsecure.

Google traffic is coming from https://google.com and therefore it does not pass the HTTP_Referer PHP parameter data.

I wish this wasn't the case.

You can get a pretty accurate view of what keywords users are coming to your site by looking at Webmaster search console.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.