【发布时间】:2018-01-19 20:35:15
【问题描述】:
当我将生产数据库中的交易与 Google Analytics(分析)电子商务仪表板中的交易进行比较时,很明显我遗漏了大量数据。我出于测试目的在我的网站上进行了购买,在成功购买后出现的“感谢页面”中,我在检查元素时看到了以下 Google Analytics(分析)跟踪代码:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '[My Google Analytics tracking ID]', 'auto');
ga('require', 'ec');
ga('ec:addProduct', {
'id': '[Product ID]', 'name': '[Product name]', 'category': '[Product category]',
'brand': '[Product brand]', 'variant': '[Product variant]', 'price': '[Product price]', 'quantity': 1 });
// Transaction level information is provided via an actionFieldObject.
ga('ec:setAction', 'purchase', { 'id': '[Transaction ID]', 'affiliation': '[Organization where the transaction took place]', 'revenue': '[Revenue value]' });
ga('send', 'pageview');
</script>
此交易发生在大约 24 小时前。当我转到 Google Analytics 电子商务仪表板的“销售业绩”部分时,当我使用我在上面'id': '[Transaction ID]' 中发送的 ID 查找交易时,我找不到该交易:
在上面的椭圆中,我提供了 [Transaction ID],但如您所见,它没有找到。我在我的数据库中发现了很多案例,其中有些交易在 Google Analytics(分析)电子商务中找不到。
Google Analytics(分析)显示了一些交易,但不是全部。我检查了发送到 Google Analytics 的代码,它是正确的,没有语法错误,一切都很完美。为什么 Google Analytics(分析)电子商务“销售业绩”部分缺少交易?谢谢。
更新 1:
对于'name': '[Product name]',我将作为[Product name] 发送一个145 B 的字符串。给你一个想法,它大约有这么长:
¡ Lore T99 mi psumi ss E325 impl Dummyte Xtífthe + Printingand 排版 (Iñd Ustrylore, Ips um Hasbee, Nthein) Dustr Ss Ttandar! (2018-01-05)
文本包含以下特殊字符:
- ¡
- 我
- +
- (
- ñ
- ,
- )
- !
- -
是长度问题(145 B),还是我在[Product name]中发送特殊字符的事实?
【问题讨论】:
-
我也有同样的问题。
-
您是否尝试过使用调试器进行事务处理? chrome.google.com/webstore/detail/google-analytics-debugger/…
-
我不知道那个插件的存在。我能够找到问题,但下次遇到类似问题时,我知道我可以使用 Google Analytics Debugger。谢谢。
标签: google-analytics transactions