1

我很难在以下 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>

任何人都可以在这里看到这个问题吗?

4

1 回答 1

1

看起来您缺少category参数_addItem- 请参阅_addItem 的 Google 文档

虽然该category参数是可选的,但将其省略会导致quantity缺少必需的参数。

如果没有,则可以传递一个空字符串category

_gaq.push(['_addItem', 
'28996', 
'150649', 
'BRAUN ORAL-B ELTANDB&#216;RSTE', 
'',
'99.00', 
'1' 
]); 
于 2013-04-17T16:45:52.833 回答