[英]GA - E-commerce not tracking items
我在以下javascript代碼中很難找到問題。
Google Analytics(分析)可以很好地跟蹤我的交易,但沒有顯示任何產品。
該代碼取自收據頁面上的“查看源代碼”。
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'xxxxxxx-x']); // I replaced my account no.
_gaq.push(['_trackPageview']);
_gaq.push(['_set', 'currencyCode', 'DKK']);
_gaq.push(['_addTrans',
'28996',
'xxxxx.xx', // I replaced the domainname with xxxxx.xx
'104.00',
'20.80',
'0.00',
'fredercia',
'Denmark'
]);
_gaq.push(['_addItem',
'28996',
'150649',
'BRAUN ORAL-B ELTANDBØRSTE',
'99.00',
'1'
]);
_gaq.push(['_addItem',
'28996',
'150000',
'5 dages LOP-salg',
'5.00',
'1'
]);
_gaq.push(['_trackTrans']);
(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);
})();
</script>
有人可以在這里看到問題嗎?
似乎您缺少_addItem
的category
參數-請參見_addItem
的Google文檔 。
雖然category
參數是可選的,但將其忽略將導致缺少必需的quantity
參數。
如果沒有,則可以為category
傳遞一個空字符串:
_gaq.push(['_addItem',
'28996',
'150649',
'BRAUN ORAL-B ELTANDBØRSTE',
'',
'99.00',
'1'
]);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.