YouTube未显示为推介人? [英] YouTube not showing as a referrer?

查看:113
本文介绍了YouTube未显示为推介人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在跟踪我网站的推荐人并将其存储在会话中,以便在他们执行某些操作时在某些报告中使用。

I've been tracking referrers to my site and storing it a session to be used in some reports when they do certain actions.

要获得推荐人,我只需 $ _ SESSION [s1] = $ _SERVER [HTTP_REFERER];

To get the referrer, I just do $_SESSION["s1"] = $_SERVER["HTTP_REFERER"];

它似乎工作除了YouTube以外的一切。点击YouTube上的链接会生成空白引荐来源。什么可能导致这个? YouTube会对标题做些什么吗?打开一个新窗口会丢失推荐人信息吗?

It seems to work for everything except YouTube. Clicking a link on YouTube generates a blank referrer. What could cause this? Does YouTube do something to the headers? Does opening a new window lose the referrer info?

推荐答案

我今天遇到了同样的问题。虽然这个问题是5年之久,但当我搜索原因时,它首先出现在Google上;所以我会在这里回答其他偶然发现它的人。

I came across this same issue today. Even though this question is 5 years old it came up first on Google when I searched for the cause; so I am going to answer it here for others who stumble across it.

这个问题与YouTube没有多大关系,实际上是由浏览器引起的。当流量从HTTPS切换到HTTP时,某些浏览器将删除 referer 标头。要维护 referer 标头,您必须将其链接到使用HTTPS作为其协议的URI。

The issue is not so much related to YouTube and is actually caused by the browser. Some browsers will remove the referer header when traffic switches protocols from HTTPS to HTTP. To maintain the referer header you would have to link it to a URI that uses HTTPS as its protocol.

这篇关于YouTube未显示为推介人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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