如标题所示,如何通过两个不同的帐户使用 Google Analystics 跟踪网站?
我对这个主题做了一些研究,发现很多旧帖子都说你应该在每一侧包含不同的跟踪代码。但这不是最好的方法,对吗?
可以做这样的事情吗?
旧代码:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-1']);
_gaq.push(['_trackPageview']);
(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);
})();
</script>
新代码:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-1']);
_gaq.push(['_setAccount', 'UA-xxxxxxxx-2']);
_gaq.push(['_trackPageview']);
(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);
})();
</script>
提前感谢 jack
最佳答案
是的,无需更新任何旧代码即可实现。您必须将其他帐户添加到主帐户:
点击 Google 分析页面顶部的管理。
显示三列帐户、属性、查看。
根据访问权限从帐户、属性(property)、查看中选择用户管理。
输入电子邮件地址并分配卷。
检查您的辅助电子邮件地址网站跟踪是否与主电子邮件地址相同。
关于javascript - 谷歌分析,使用两个不同的帐户跟踪同一网站,如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22068255/