我设置了子域static.map.ninux.org以加载域map.ninux.org的静态文件。目标是建立一个无Cookie的域名。Google Analytics(分析)消除了我制作无Cookie域的努力
我查了一下,发现map.ninux.org上的google analytics使用“.map.ninux.org”域创建cookie,由于某些原因,该域也对static.map.ninux.org有效。
我该如何解决这个问题?
PS:这段代码是否正确?
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26436344-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_setDomainName', 'map.ninux.org']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
有了这个,我仍然得到与主机饼干 “.map.ninux.org”
我添加到答案的代码是否正确?我仍然通过host:“.map.ninux.org”获得cookie。 :-( – nemesisdesign
添加到问题*对不起。 – nemesisdesign
已更新我的回答。 – Seybsen