簡體   English   中英

GA-電子商務未跟蹤商品

[英]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&#216;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>

有人可以在這里看到問題嗎?

似乎您缺少_addItemcategory參數-請參見_addItemGoogle文檔

雖然category參數是可選的,但將其忽略將導致缺少必需的quantity參數。

如果沒有,則可以為category傳遞一個空字符串:

_gaq.push(['_addItem', 
'28996', 
'150649', 
'BRAUN ORAL-B ELTANDB&#216;RSTE', 
'',
'99.00', 
'1' 
]); 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM