我们公司运营一个网站(oursite.com),与联盟合作伙伴一起向我们的流量发送方向。在某些情况下,我们为我们的联盟合作伙伴设置自己的子域名(affiliate.oursite.com),并且他们使用iframe在他们的网站(affiliate.com)上显示我们网站的选定内容。
他们网站上的页面示例:
<html>
<head></head>
<body>
<iframe src="affiliate.example.com/example_page.html">
...content...
[google analytics code for affiliate.oursite.com]
</iframe>
[google analytics code for affiliate.com]
</body>
</html>
我们希望为 affiliate.oursite.com 启用 Google Analytics 追踪。目前,在 iframe 加载页面时,Google 似乎无法从 affiliate 获取任何数据。
现在,使用 JavaScript 访问不同域中的页面信息存在安全隐患,而 IE 则不喜欢为不同域设置 cookie。
有没有人有解决办法?我们需要将 affiliate.oursite.com 的 CNAME 指向 cname.oursite.com,还是有更好的解决方案?