如何知道用户是否来自Facebook链接? [英] How to know if user came from a Facebook link?

查看:157
本文介绍了如何知道用户是否来自Facebook链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果Facebook上有链接发布到我的网站,并且用户关注它,我想使用PHP显示自定义内容。我尝试使用以下方法......

If there is a link posted on Facebook to my website, and a user follows it, I would like to display custom content using PHP. I tried with the following method...

$_SERVER['HTTP_REFERER']

Facebook必须阻止此功能,因为它无效。有没有一种实际适用于Facebook的方法?

Facebook must block this feature because it is not working. Is there a method for this that actually works with Facebook?

推荐答案

这条新闻已经有一年了,但我发现它们仍然存在使用它..我在这里发布它因为它仍然是相当丰富的信息链接的亮点是 https ://www.facebook.com/note.php?note_id = 10151070897728920

This news is a year old, yet I see they are still using it.. I post it here because It is still pretty informative The srouce of the link is https://www.facebook.com/note.php?note_id=10151070897728920


限制推荐人

Restricting the Referrer

我们仍然需要让您浏览的网站知道Facebook的流量是
,但我们也希望阻止他们阅读完整的
源网址。否则,当你点击他们的链接
时,他们可以知道你在网站上的位置。为了实现这一平衡,我们采用了一项名为meta referrer的新功能,目前
可用于Chrome 17+和Safari 6+。这允许我们指定
如何通过Referer
标头与外部网站共享大部分源URL。如果您使用这些支持的浏览器之一,您可以获得这项新功能的
优势。否则,您的浏览器将被路由
到稍慢的旧系统。

We still need to let the websites you navigate to know the traffic is from Facebook, but we also want to prevent them from reading the full source url. Otherwise, they could know where on the site you were when you clicked their link. In order to strike this balance, we've taken advantage of a new feature called the meta referrer, currently available in Chrome 17+ and Safari 6+. This allows us to specify how much of the source url to share with the external site via the Referer header. If you're using one of these supported browsers you can take advantage of this new feature. Otherwise, your browser will be routed to the slightly slower older system.

此更改应减少链接垫片对您浏览
的影响(特别是从蜂窝网络访问Facebook时)和
应该有助于节省典型用户大约一秒钟。

This change should reduce the impact of the link shim on your browsing (especially when accessing Facebook from a cellular network) and should help save around a second for a typical user.

这篇关于如何知道用户是否来自Facebook链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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