Google Analytics(分析)“未检测到HTTP响应”同时跟踪多个帐户并使用链接器 [英] Google Analytics "No HTTP response detected" while tracking multiple accounts and using linker

查看:130
本文介绍了Google Analytics(分析)“未检测到HTTP响应”同时跟踪多个帐户并使用链接器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图不仅跟踪两个不同的GA帐户,还要在一个帐户上使用站点间的连接器。 Google使用链接器返回了错误:未检测到HTTP响应。

I am trying to not only track two different GA accounts, but also on one account I need to use a linker between sites. Google is coming back with "Error: No HTTP response detected" on the site using the linker.

以下是代码,感谢您的帮助。

Here is the code, thanks for the help.

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXXX-1', 'site1.com');
ga('create', 'UA-XXXXXXX-4', 'auto', {'name': 'siteLinker','allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['site2.com','site3.com'] );
ga('require', 'displayfeatures');
ga('send', 'pageview');


推荐答案

查看Google的文档使用多个跟踪器。您错过的唯一命令是发送第二个'siteLinker'跟踪器的第二个浏览量。

Take a look at Google's documentation for Working with Multiple Trackers. The only command you missed was to send the second pageview of the second 'siteLinker' tracker.

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXXX-1', 'site1.com');
ga('create', 'UA-XXXXXXX-4', 'auto', {'name': 'siteLinker','allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['site2.com','site3.com'] );
ga('require', 'displayfeatures');
ga('send', 'pageview');

// Missing the send command for the second 'named' tracker
ga('siteLinker.send', 'pageview');

我还注意到有一个analytics.js文件是从外部脚本中加载的。任何理由为什么这是听到?当我尝试调试时,它会发生干扰。

I also noticed that there is an analytics.js file loading from an external script in the . Any reason why this is hear? It was interfering when I was trying to debug.

这篇关于Google Analytics(分析)“未检测到HTTP响应”同时跟踪多个帐户并使用链接器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆