我的新谷歌通用分析代码在 chrome 的分析调试器插件中给了我错误:
初始化谷歌分析。analytics_debug.js:9
注册新插件:ga(provide, "linker", Function) analytics_debug.js:9
注册新插件:ga(provide, "displayfeatures", Function) analytics_debug.js:9
运行命令:ga(create, UA--1, amleo.com) analytics_debug.js:9
创建新的跟踪器:t0 analytics_debug.js:9
新访客。生成新的clientId analytics_debug.js:9
运行命令:ga(send, pageview) analytics_debug.js:9
存储不可用。中止命中。analytics_debug.js:9
执行谷歌分析命令。analytics_debug.js:9
运行命令:ga(send, event, rfk, rfk_1, rfk_1,rg_1,rw_1,) analytics_debug.js:9
存储不可用。中止命中。
在 Google Analytics Tag Assistant chrome 插件中,它显示“严重错误”,错误内容如下:
错误:未检测到 HTTP 响应
我在所有页面上的正常跟踪代码为:(我缩小了直接从谷歌分析管理员复制的跟踪片段)
<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', 'UA-1-1', 'amleo.com');ga('send', 'pageview');</script>
我的电子商务跟踪代码如下:
<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', 'UA--1', 'amleo.com');ga('send', 'pageview');
//Include the ecommerce plugin
ga('require', 'ecommerce', 'ecommerce.js');
//Initialize the transaction
ga('ecommerce:addTransaction', {
'id': 'WEBA001399736',// order ID - required
'affiliation': 'A.M. Leonard',// affiliation or store name
'revenue': '19.99',// total - required
'shipping': '9.99',// shipping
'tax': '2.10',// tax
});
ga('ecommerce:addItem', {
'id': 'WEBA001399736',// order ID - necessary to associate item with transaction
'name': 'Leonard+ArborRain+Tower+-+Plant+%26+Tree+Hydrator',// product name
'sku': 'ART20',// SKU/code - required
'category': '',// category or variation
'price': '19.99',// unit price - required
'quantity': '1'// quantity - required
});
ga('ecommerce:send');//submits transaction to the analytics servers
</script>