这是我第一次使用Google Analytics电子商务跟踪来获取购买的多件商品的数据。我只收到GA的早晨回合和额外捐赠产品,总订单为21美元。我尝试使用GA调试器,但它没有给我任何错误。有什么想法吗?
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-2']);
_gaq.push(['_setDomainName', 'mercyhome.org']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'1234567890',// order ID - required
'Golf Classic Registration',// affiliation or store name
'1,520.00',// total - required
'0.00', // tax
'0.00', // shipping
'Chicago',// city
'IL',// state or province
'US'// country
]);
//add item might be called for every item in the shopping cart
//where your ecommerce engine loops through each item in the cart and
//prints out _addItem for each
_gaq.push(['_addItem',
'1234567890',// order ID - required
'13M88GO901',// SKU/code - required
'Afternoon Round Individual Golfer',// product name
'Golf Classic', // category or variation
'300',// unit price - required
'1'// quantity - required
]);
_gaq.push(['_addItem',
'1234567890',// order ID - required
'13M88GO901',// SKU/code - required
'Morning Round Playing Foursome',// product name
'Golf Classic', // category or variation
'1,200',// unit price - required
'1'// quantity - required
]);
_gaq.push(['_addItem',
'1234567890',// order ID - required
'13M88GO902',// SKU/code - required
'Additional Donation',// product name
'Golf Classic', // category or variation
'20.00',// unit price - required
'1'// quantity - required
]);
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
(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);
})();
答案 0 :(得分:4)
看起来下午和早上的物品都有相同的SKU。
来自_addItem()
docs:
Ensure that each item in your inventory has a unique SKU.
If your inventory has different items with the same SKU, and a visitor purchases both of them, you will receive data for only the most recently added.