您如何检测您的网站访问者是否来自Google搜索结果? [英] how do you detect if your website visitor came from a google search result?

查看:93
本文介绍了您如何检测您的网站访问者是否来自Google搜索结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户从Google搜索并从结果页面中显示的结果登陆我们的网站时,我的网站是否可以检测到他来自Google?

when a user searches from google and lands on our site from the results he/she was shown in the results page, is there a way for my site to detect that he came from google?

推荐答案

检查应包含引用URL的$_SERVER['HTTP_REFERER']变量.请注意,这不是防篡改或故障保护的方法,因为Http-Referer标头很容易被客户端更改或修改.

Check the $_SERVER['HTTP_REFERER'] variable which should contain the referring URL. Please note that this is not tamper-proof or fail-safe as the Http-Referer header can easily been changed or modified by a client.

只需用Google搜索phpinfo(因为杂音很高,因为我得到一个显示$_SERVER['HTTP_REFERER']变量的phpinfo()页面),向您展示Http-Referer的外观:

Just googled for phpinfo (because chanes were high that I get a phpinfo() page that shows the $_SERVER['HTTP_REFERER'] variable) to show you how the Http-Referer will look like:

$_SERVER['HTTP_REFERER'] = "http://www.google.de/search?hl=de&q=phpinfo&btnG=Google-Suche&meta="

如您所见,您还可以提取google查询中使用的搜索字词(或检测搜索是否由Google Chrome浏览器地址栏启动)...

As you see, you can also extract the search term used in the google query (or detect if the search was initiated by the Google Chrome address bar)...

这篇关于您如何检测您的网站访问者是否来自Google搜索结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆