gpt4 book ai didi

javascript - GA 电子商务跟踪数据未发送

转载 作者:行者123 更新时间:2023-12-03 09:47:13 27 4
gpt4 key购买 nike

我有以下电子商务跟踪代码。我正在使用多个跟踪器。页面浏览量已正确跟踪,但当我查看电子商务报告时,没有数据通过。我错过了什么?

(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-34658431-1', 'auto', {'name' : 'primary'}); // primary tracker
ga('create', 'UA-64375824-1', 'auto', {'name': 'secondary'}); // secondary tracker.

ga('secondary.send', 'pageview');
ga('primary.send', 'pageview');

ga('primary.require', 'ecommerce');
ga('secondary.require', 'ecommerce');
//ga('primary.ecommerce:clear');
//ga('secondary.ecommerce:clear');

var transaction_id = '1';

var ga_transaction = {
'id': transaction_id,
'affiliation': 'primary',
'revenue': '2.46',
'shipping': '',
'tax': ''
};

ga('primary.ecommerce:addTransaction', ga_transaction);
ga('secondary.ecommerce:addTransaction', ga_transaction);

var ga_item = {
'id': transaction_id,
'name': 'Test',
'sku': 'Pc6Q',
'category': 'eBook',
'price': '2.00',
'quantity': '1'
};

ga('primary.ecommerce:addItem', ga_item);
ga('secondary.ecommerce:addItem', ga_item);

ga('secondary.ecommerce:send');
ga('primary.ecommerce:send');

最佳答案

就像我在评论中指出的那样(就像您现在在文档中发现的那样),存在处理延迟(通常,交易、自定义维度和自定义指标的延迟时间比页面浏览量和事件的时间长得多)。

为了他人的利益,这里是相关部分from the documenation :

Data processing latency Processing latency is 24-48 hours. Standard accounts that send more than 200,000 sessions per day to Google Analytics will result in the reports being refreshed only once a day. This can delay updates to reports and metrics for up to two days. To restore intra-day processing, reduce the number of sessions you send to < 200,000 per day. For Premium accounts, this limit is extended to 2 billion hits per month.

数据可能处理得更快,但您不能依赖它。

所以这个问题只要等待就可以解决。

关于javascript - GA 电子商务跟踪数据未发送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30984255/

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