我很难在下面的javascript代码中找到这个问题。
Google Analytics可以很好地跟踪我的交易,但它没有显示任何产品。
这段代码取自收据页面的"view sourcecode code“。
<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>任何人都能看到这里的问题吗?
发布于 2013-04-18 00:45:53
看起来您缺少_addItem的category参数--请参阅Google Docs for _addItem。
虽然category参数是可选的,但如果不使用它,将导致缺少所需的quantity参数。
如果没有空字符串,可以为category传递一个空字符串:
_gaq.push(['_addItem',
'28996',
'150649',
'BRAUN ORAL-B ELTANDBØRSTE',
'',
'99.00',
'1'
]); https://stackoverflow.com/questions/16064649
复制相似问题