1

这是我第一次使用 Google Analytics 电子商务跟踪来获取购买的多件商品的数据。我只在 GA 收到 Morning Round 和 Additional Donation 产品,总订单为 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);
})();

4

1 回答 1

4

下午和早上的商品似乎具有相同的 SKU。从_addItem() 文档

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.
于 2012-06-28T22:29:14.187 回答