Check if page comes from Google?

1

Good Night

How can I do via PHP to find out if the user came from Google and what keyword was entered? So when he signs up on my site, I can check where he came from and who found the site.

Thank you

    
asked by anonymous 15.03.2016 / 03:06

1 answer

1

You can just verify that you came from one of Google's domains.

A simple example with PHP is to read the global variable $_SERVER['HTTP_REFERER'] .

However, we can not retrieve search terms from the referrer URL because the terms are encoded. The coding combines with unique user codes, that is, when so searches for " something " will generate a string GVhao390# , but beltran search for the same word, will return a different string 6%U9*8Ed . The key is in the ved parameter.

One of the reasons for coding the terms is due to users' privacy issues.

To get search reference data, use Google Webmaster Tools and Google Analytics .

  • The encoded string is merely illustrative
15.03.2016 / 03:42