gpt4 book ai didi

javascript - Google Analytics 电子商务跟踪仅收到 3 件商品中的 2 件

转载 作者:行者123 更新时间:2023-11-30 10:40:36 25 4
gpt4 key购买 nike

这是我第一次使用 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);
})();

最佳答案

看起来下午和早上的商品具有相同的 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.

关于javascript - Google Analytics 电子商务跟踪仅收到 3 件商品中的 2 件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11252192/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com