Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google analytics 如何在Google Analytics页面上查看我的多个域?_Google Analytics_Google Analytics Api - Fatal编程技术网

Google analytics 如何在Google Analytics页面上查看我的多个域?

Google analytics 如何在Google Analytics页面上查看我的多个域?,google-analytics,google-analytics-api,Google Analytics,Google Analytics Api,我在我的两个独立的域中插入了下面的代码:www.productsstage.com和www.truthstage.com(这实际上是下面的同一个网站)。 如何查看productsstage.com上收到的点击量和truthstage.com上收到的点击量 试一试{ var _gaq=_gaq | |[]; _gaq.push([''设置帐户','UA-61764359-1']); _gaq.push([''u setDomainName',window.location.hostname.su

我在我的两个独立的域中插入了下面的代码:www.productsstage.com和www.truthstage.com(这实际上是下面的同一个网站)。 如何查看productsstage.com上收到的点击量和truthstage.com上收到的点击量


试一试{
var _gaq=_gaq | |[];
_gaq.push([''设置帐户','UA-61764359-1']);
_gaq.push([''u setDomainName',window.location.hostname.substring(4)];
_gaq.push([''设置Allowlinker',true]);
_gaq.push([''u trackPageview']);
(功能(){
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);
})();
}捕获(e){}
我确实在stackoverflow上看到了这一点,但它看起来像是以前Google Analytics UI的说明

谢谢你在这方面的帮助


Jim.

有什么理由让你在两个不同(尽管相似)的网站上使用相同的跟踪代码?为什么不使用两个不同的属性跟踪?您可以将“主机名”设置为第二个维度。对于更持久的解决方案,您可以创建两个视图,每个视图的每个主机名都有一个包含筛选器(包括主机名包含productstage的位置和主机名包含thruthstage的位置)。因为这不需要代码,所以这里实际上是离题了……感谢您的回复,但我对如何在Google Analytics网页上实际查看它感兴趣。去哪里看?在哪个选项下?。我想我的Javascript是正确的(通过阅读和复制官方文档)纽恩:我需要单独跟踪它,以查看我的客户最喜欢哪个域。@JimD,我刚刚告诉过你如何做。“次要维度”是GA界面中数据表中的一个选项。听@EikePierstorff,他知道他在说什么。
<script type="text/javascript">
    try{
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-61764359-1']);
        _gaq.push(['_setDomainName', window.location.hostname.substring(4)]);
        _gaq.push(['_setAllowLinker', true]);
        _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);
        })();
    }catch(e) {}
</script>