Google アナリティクスの e コマース トラッキングを使用して、購入した複数のアイテムのデータを取得するのはこれが初めてです。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);
})();