简体   繁体   English

如何知道用户是否来自Facebook链接?

[英]How to know if user came from a Facebook link?

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. 如果在Facebook上发布了指向我的网站的链接,并且用户跟踪它,那么我想使用PHP显示自定义内容。 I tried with the following method... 我尝试了以下方法...

$_SERVER['HTTP_REFERER']

Facebook must block this feature because it is not working. Facebook必须阻止此功能,因为它无法正常工作。 Is there a method for this that actually works with Facebook? 有没有一种方法可以在Facebook上实际使用?

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 该新闻已有一年历史了,但是我看到他们仍在使用它。.我在这里发布是因为它仍然非常有用。该链接的链接为https://www.facebook.com/note.php?note_id=10151070897728920

Restricting the Referrer 限制引荐来源

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. 我们仍然需要让您浏览的网站知道访问量来自Facebook,但是我们也希望阻止它们读取完整的源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+. 为了达到这种平衡,我们利用了称为meta Referrer的新功能,该功能目前在Chrome 17+和Safari 6+中可用。 This allows us to specify how much of the source url to share with the external site via the Referer header. 这使我们可以通过Referer标头指定要与外部站点共享的源url数量。 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. 否则,您的浏览器将被路由到速度稍慢的旧系统。

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时),并应为典型用户节省大约一秒钟的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM