我正在使用 Google Analytics 构建自己的网络分析引用库, Open Web Analytics .
在 Google Analytics 中,域被散列并且该散列存储在 cookie 中.
我在 urchin tracker 中发现了类似的哈希技术:
function(d) {
if (!d || d == "") return 1;
var h = 0,
g = 0;
for (var i = d.length - 1; i >= 0; i--) {
var c = parseInt(d.charCodeAt(i));
h = ((h << 6) & 0xfffffff) + c + (c << 14);
if ((g = h & 0xfe00000) != 0) h = (h ^ (g >> 21));
}
return h;
}
在谷歌分析中对域进行哈希处理是否有任何特定原因或仅供引用?
任何想法都会受到赞赏。
最佳答案
来自 _setAllowHash()
的文档:
The domain hashing functionality in Google Analytics creates a hash value from your domain, and uses this number to check cookie integrity for visitors.
请注意,_setAllowHash
已被弃用——我不知道这是否意味着 Google Analytics 不再使用域哈希进行 cookie 验证或其他...
关于javascript - 为什么域在谷歌分析中被散列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15564554/