是否有任何“异步跟踪”的缺陷?与谷歌分析? [英] Are there any drawbacks of "asynchronous tracking" with Google Analytics?

查看:145
本文介绍了是否有任何“异步跟踪”的缺陷?与谷歌分析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

旧回答我最近了解到Google Analytics除了传统的追踪程式码外,还提供所谓的异步跟踪。从文档看来,异步跟踪似乎比传统跟踪更受欢迎: b
$ b


与传统安装不同,异步跟踪优化了浏览器加载ga.js,以便将对用户体验的影响降至最低。它还允许您将Google Analytics代码片段放在页面的较高位置,而不会延迟后续渲染内容。


文档没有提到使用异步跟踪,这让我想知道为什么这不是默认的跟踪方法。在应该注意的异步跟踪方面是否存在任何缺陷,或者我应该继续并在所有安装中进行切换? 解决方案

异步跟踪仅在2个月前发布。他们只是在它们在整个网络上发布之前进行beta测试。他们只是遇到了麻烦,我听说人们在谷歌的安装页面上呼叫了一些东西:


我们已经确定,在大多数页面,
异步代码段的最佳位置位于< body>顶部,部分。虽然将b $ b代码放置在< head>部分,将
异步片段放在那里可能会触发Internet Explorer 6
和某些页面上的7的解析错误。解决这个问题的最简单方法是将
放在该部分的顶部。



From an old answer I have recently learned that Google Analytics, besides the traditional tracking code, offers so-called "asynchronous tracking". From the documentation, it seems like asynchronous tracking is to be preferred over the traditional tracking:

Unlike a traditional installation, asynchronous tracking optimizes how browsers load ga.js so its impact on user experience is minimized. It also allows you to put your Analytics snippet higher in the page without delaying subsequent content from rendering.

The documentation mentions no drawbacks from using asynchronous tracking, which makes me wonder why this is not the default tracking method. Are there any pitfalls around asynchronous tracking that one should be aware of, or should I go ahead and make the switch on all installations?

解决方案

Async tracking was only released 2 months ago. They're just beta testing it before they unleash it on the entire web. They only trouble I've heard people have is with something Google calls out on its installation page:

We've determined that on most pages, the optimal location for the asynchronous snippet is at the top of the <body> section. While it is customary to place JavaScript code in the <head> section, placing the asynchronous snippet there may trigger a parsing bug in Internet Explorer 6 and 7 on some pages. The easiest solution to this problem is to place it at the top of the section.

这篇关于是否有任何“异步跟踪”的缺陷?与谷歌分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆