简体   繁体   中英

Google Analytics Ecommerce Tracking only receiving 2 of 3 items

This is my first time using Google Analytics Ecommerce Tracking to get data for multiple items purchased. I'm only receiving the Morning Round and Additional Donation products in GA with a total order of $21. I tried using the GA Debugger but it didn't give me any errors. Any ideas?

<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);
})();

It looks like both the Afternoon and Morning items have the same SKU. From the _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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM