我阅读了谷歌电子商务跟踪分析的文档。我只是按照它的指示,复制并粘贴到测试页面上,然后才能在lives网站上进行测试。我的问题是,我没有看到任何关于电子商务跟踪的东西,尽管我遵循了它的例子。有人能帮我吗?谢谢
以下是谷歌分析电子商务文档:
https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
<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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-87205702-2', 'auto');
ga('send', 'pageview');
ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
'id': '1234', // Transaction ID. Required.
'affiliation': 'Acme Clothing', // Affiliation or store name.
'revenue': '11.99', // Grand Total.
'shipping': '5', // Shipping.
'tax': '1.29' // Tax.
});
ga('ecommerce:send');
</script>
是的,我启用了“启用电子商务”和“增强电子商务设置”