gpt4 book ai didi

google-analytics - 使用跟踪代码管理器部署 Analytics 时运行 Google Optimize 会导致错误

转载 作者:行者123 更新时间:2023-12-02 19:55:57 25 4
gpt4 key购买 nike

更新:

A/B 测试运行良好。
重定向测试正在运行,但未返返回告。

<小时/>

我关注了 Google 的文章 How to use Optimize when you deploy Google Analytics with Google Tag Manager ,但我在 Google Optimize 上不断收到错误:

Something seems wrong. Your experiment is running but hasn't received visits.

我使用了 Analytics 调试器,一切似乎都很好,所以我请求您的帮助。
这是我的设置:

<meta charset="utf-8">
<script>dataLayer = [...]</script>

//Page hiding snippet
<style>.async-hide {
opacity: 0 !important
} </style>
<script>(function (a, s, y, n, c, h, i, d, e) {
s.className += ' ' + y;
h.start = 1 * new Date;
h.end = i = function () {
s.className = s.className.replace(RegExp(' ?' + y), '')
};
(a[n] = a[n] || []).hide = h;
setTimeout(function () {
i();
h.end = null
}, c);
h.timeout = c;
})(window, document.documentElement, 'async-hide', 'dataLayer', 4000,
{'GTM-XXXXXXX': true});</script> //Optimize container id

//Requiring optimize in the analytics code, but not calling a pageview
<script>
(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', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-YYYYYYYYY-YY', {name: 'rollup', cookieName: '_rollupGa', allowLinker: true}); //Rollup analytics tracking id
ga('rollup.require', 'GTM-XXXXXXX'); //Optimize container id
</script>

//Tag manager snippet
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
'gtm.start': new Date().getTime(), event: 'gtm.js'
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-ZZZZZZ'); //Tag manager id
</script>

以下是我在 Google 跟踪代码管理器中的设置:

此类网页的示例:TAG Heuer Men's WAZ1110.BA0875 Stainless Steel Watch

任何帮助将不胜感激!

最佳答案

检查 Analytics 配置是否不匹配。例如,如果您的 GA 代码将 cookieDomain 设置为特定值并将优化代码设置为另一个值,您可能会遇到奇怪的行为。

All Analytics tracking code on your page must have the same tracker configuration settings. This is important a) if you use Google Tag Manager to fire Analytics hits, and you use hard-coded Analytics + Optimize code to deploy Optimize, or b) if you deploy Analytics and Optimize tags via Tag Manager. If you deploy Optimize via a Tag Manager tag, the best practice is to use the shared Google Analytics Settings variable in Tag Manager, which ensures your tracker settings match between tags.

Source: Installation diagnostics

关于google-analytics - 使用跟踪代码管理器部署 Analytics 时运行 Google Optimize 会导致错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43295591/

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