gpt4 book ai didi

google-analytics - Google Analytics(分析)上的多个异步跟踪不起作用

转载 作者:行者123 更新时间:2023-12-03 16:06:18 24 4
gpt4 key购买 nike

我的目标是在每个网站上设置2个跟踪:一个特定于该网站,另一个用于聚合属于网络的网站的数据。

here is the code i implemented :

// UA-XXXXXXXX-1 = Global tracking
// UA-XXXXXXXX-2 = Specific tracking

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
_gaq.push(["_setCustomVar", 1, "Type", "Value_Type", 1]);
_gaq.push(['_trackPageview']);
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-XXXXXXXX-2']);
_gaq2.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);
})();

This code is not working : specific tracking is not working. Any idea why ?
Thanks in advance

最佳答案

您的代码应该看起来像这样:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
_gaq.push(["_setCustomVar", 1, "Type", "Value_Type", 1]);
_gaq.push(['_trackPageview']);

_gaq.push(['SPECIFIC._setAccount', 'UA-XXXXXXXX-2']);
_gaq.push(['SPECIFIC._trackPageview']);

关于google-analytics - Google Analytics(分析)上的多个异步跟踪不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15405545/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com