On December 1, 2009, Google announced support for asynchronous Google Analytics tracking.
The asynchronous tracking is achieved using the async directive for the <script>
tag.
Which browsers support the async directive (<script async="async" />
) and since which version?
This question is related to
javascript
html
performance
asynchronous
google-analytics
Just had a look at the DOM (document.scripts[1].attributes) of this page that uses google analytics. I can tell you that google is using async="".
[type="text/javascript", async="", src="http://www.google-analytics.com/ga.js"]
From your referenced page:
http://googlecode.blogspot.com/2009/12/google-analytics-launches-asynchronous.html
Firefox 3.6 is the first browser to officially offer support for this new feature. If you're curious, here are more details on the official HTML5 async specification.
There's two parts to this question, really.
Q: Which browsers support the "async" attribute on a script tag in markup?
A: IE10p2+, Chrome 11+, Safari 5+, Firefox 3.6+
Q: Which browsers support the new spec that defines behavior for the "async" property in JavaScript, on a dynamically created script element?
A: IE10p2+, Chrome 12+, Safari 5.1+, Firefox 4+
As for Opera, they are very close to releasing a version which will support both types of async. I've been working with them closely on this, and it should come out soon (I hope!).
More info on ordered-async (aka, "async=false") can be found here: http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order
Also, to test if a browser supports the new dynamic async property behavior: http://test.getify.com/test-async/
A comprehensive list of browser versions supporting the async
parameter is available here
The async
is currently supported by all latest versions of the major browsers. It has been supported for some years now on most browsers.
You can keep track of which browsers support async (and defer) in the MDN website here:
https://developer.mozilla.org/en-US/docs/HTML/Element/script
Source: Stackoverflow.com