php - How to learn from what search engine and with which query a user found my site? -


i know search engine , particular query led user site. have partially solved problem. can determine search engine user has logged in site. not able find out query has been used.

this have far:

$r=$_server['http_referer']; echo "<br />this 1^".$r;  $a=$_server['remote_addr']; $u=$_server['request_uri']; $r=urldecode ($r);      echo "this  ip - ".$a."<br>"; echo "this  - ".$u."<br>"; if (strpos($s, "yandex") != 0) {   preg_match('"text=(.*?)[^&]*"', $s, $arr);   echo "this  ".$arr[1]; } elseif (strpos($s, "google") != 0) {   preg_match('/q=(.*)&/sei', $s, $arr);   echo "this  google ".$arr[1]; } elseif (strpos($s, "rambler") != 0) {   preg_match('"query=(.*?)[^&]*"', $s, $arr);   echo "this  rambler  ".$arr[1]; } else {   echo "this  ".$r; } echo "<br />this ^^".$r; echo "<br />this  ^^".$r; 

all $_server ['http_referer'] appears encoded this:

this  ^^http://www.google.ru/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0cb8qfjaa&url=http%3a%2f%2fxn--80aag0ab4aqcid.xn--p1ai%2f&ei=yudxu6l3pkpmyao-3id4aw&usg=afqjcnhutfnvlihqgsuc9skqk8qje9k3bg&sig2=12uxctusuar5pvaqgxb_hg            

how can find out search query led user site?

you can't search query when search comes google. other search providers still provide keyword data (at moment).

the reason because google has moved secure search (encrypted searches using https). see goodbye, keyword data: google moves entirely secure search more information:

nearly 2 years after making 1 of biggest changes secure search resulted in steady rise in "(not provided)" data, google has switched searches on encrypted searches using https. means no more keyword data passed site owners.

encrypted google searches don't pass keyword data through websites, thereby eliminating ability track users keyword searches.

...

at point, seems when aren't logged in, using private browsing (or incognito mode) , forcibly type , being redirected https version, thereby encrypting search , no doubt leading total removal of keyword data – @ least google search visitors. remember, keyword data other search engines – bing, example – still send keyword data through.

see how referer search query google?


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -