Google Analytics:跟踪页面浏览量,但不跟踪电子商务交易
我试图找出为什么 Google Analytics 中的电子商务跟踪似乎不起作用。我可以看到正确跟踪的页面浏览量,但没有交易。
确认页面的片段:
<head>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_setDomainName', '.mydomain.com']);
_gaq.push(['_trackPageview']);
_gaq.push(['b._setAccount', 'UA-YYYYYYYY-1']);
_gaq.push(['b._setDomainName', 'none']);
_gaq.push(['b._addTrans',
'44bbd391-ff38-4f8d-ad68-aec490666151',
'Name',
'1.00',
'',
'',
'',
'',
''
]);
_gaq.push(['b._addItem',
'44bbd391-ff38-4f8d-ad68-aec490666151',
'15',
'test',
'',
'1.00',
'1'
]);
_gaq.push(['b._trackTrans']);
_gaq.push(['b._trackPageview']);
(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);
})();
</script>
...
</head>
我正在使用 Firebug 监控页面上的流量,确认所有像素请求均已发出并正常返回。
我读到过要等几个小时,最多一天,才能在 GA 中看到结果,但我只等几分钟就可以看到页面浏览量。
但是,使用相同跟踪器对象(“b”)跟踪的交易在任何地方都找不到(电子商务报告的刷新速度可能比页面视图慢吗?)
I'm trying to figure out why the Ecommerce tracking in Google Analytics doesn't seem to work. I can see the page views correctly tracked but no transactions.
Snippet from the confirmation page:
<head>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_setDomainName', '.mydomain.com']);
_gaq.push(['_trackPageview']);
_gaq.push(['b._setAccount', 'UA-YYYYYYYY-1']);
_gaq.push(['b._setDomainName', 'none']);
_gaq.push(['b._addTrans',
'44bbd391-ff38-4f8d-ad68-aec490666151',
'Name',
'1.00',
'',
'',
'',
'',
''
]);
_gaq.push(['b._addItem',
'44bbd391-ff38-4f8d-ad68-aec490666151',
'15',
'test',
'',
'1.00',
'1'
]);
_gaq.push(['b._trackTrans']);
_gaq.push(['b._trackPageview']);
(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);
})();
</script>
...
</head>
I'm monitoring the traffic on the page with Firebug confirming that all pixel requests were made and came back OK.
I read about having to wait a few hours, up to one day, before you can see results in GA, but I can see the page views after only waiting a few minutes.
However, the transactions tracked using the same tracker object ("b") are not to be found anywhere(could the Ecommerce reports be refreshing slower than the page views?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于发现了问题。答案就隐藏在 GA 文档页面上:
它很容易被忽视,但它有一个根本性的影响:交易不会被跟踪。
所以,是的,请始终在
_trackPageview
之后调用_trackTrans
!And I finally found the issue. The answer is inconspicuously present on the GA docs page:
It's rather easy to overlook but it has such a fundamental effect: transactions won't be tracked.
So yes, always call
_trackTrans
after_trackPageview
!