我有以下電子商務跟蹤代碼。我正在使用多個跟蹤器。瀏覽量正在被正確地跟蹤,但是當我查看電子商務報告時,沒有任何數據正在通過。我錯過了什麼?GA電子商務跟蹤數據未被髮送
(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');
我在瀏覽器的javascript控制檯中運行它,它運行完美無瑕。要排除顯而易見的情況,由於處理電子商務數據需要一段時間(長達24小時),您是否等待一段時間才能在報告中顯示數據? –
@EikePierstorff你說得對,我沒有等太久! Google Analytics刷新報告鏈接的重點是什麼?它甚至有時間戳!你介意給「等待」添加一個答案,而不要依賴刷新報告鏈接。可能與以下鏈接:https://support.google.com/analytics/answer/1070983?hl = zh_CN – Abs