Google Analytics is off to a good start this December with their latest launch – a new Asynchronous Tracking Code snippet. Basically, we now have another way to track websites – especially the ones that use many scripts or rely on rich media content.
Google’s blog suggests thinking about the asynchronous tracking code snippet “as a script that uses a “separate lane” to handle part of the processing of your webpage”. As the number of scripts on your page increases, the asynchronous tracker works to reduce page load time by being processed separately. Here’s how asynchronous snippet looks:
The asynchronous tracking snippet offers many benefits, including:
- Faster tracking code load times for your web pages due to improved browser execution
- Enhanced data collection and accuracy
- Elimination of tracking errors from dependencies when the JavaScript hasn’t fully loaded
So, how to do you install the new snippet? Read Google’s Installation Guide or simply read on for step by step instructions.
Before you get started, please note that asynchronous tracking is not available in urchin.js. If you are using the urchin.js snippet, you’ll have to read the Tracking Code Migration Guide.
Now, to install the asynchronous snippet on pages that either don’t currently use Google Analytics or are currently using traditional tracking with ga.js. , follow these steps:
- If the page already uses Analytics, remove your existing tracking code snippet and any customizations you have made.
To reduce errors, it is recommended that you remove the existing tracking code snippet from the include file or mechanism that injects it into your web pages. You can paste your existing tracking code snippet in a text file to keep track of any customized methods you use.
- Insert the asynchronous snippet at the bottom of the
<head>section of your pages.One of the main advantages of the asynchronous snippet is that you can put it higher in the page. More specifically, you should position it as the last script in the
<head>section. As determined by Google, putting the asynchronous snippet in the <head> is the optimal position. - Modify the
_setAccountmethod with your web property ID.For more information on web property IDs, check out the “Web Property” section in Google’s Accounts and Profiles document.
- Add your customizations back in using the asynchronous syntax. Google’s Usage Guide and Migration Examples pages provide many examples of these conversions.
Note: Even with asynchronous loading, some content might be blocked from rendering in certain browsers. To avoid this possibility, other scripts in your site should be positioned in one of these ways:
- before the tracking code snippet in the
<head>section of your HTML - after both the tracking code snippet and all page content (e.g. at the bottom of the HTML body)
If that isn’t an option, you can still put the asynchronous snippet at the bottom of the page. You can also split your snippet to retain some of the benefits of asynchronous tracking.
Now, I am not sure about you but I’m definitely taking the asynchronous snippet for a test drive.

{ 2 comments… read them below or add one }
Thank you, Maria, for the insights and for the excellent explanation. I especially appreciate your tutorial approach!
I liked your tweet,
@mattcutts Any thoughts on the GA’s asynchronous snippet benefit for SEO? Would think that faster load time makes it worthwhile.
Time to test and play with asynchronous tracking. Keep us posted on on your observations!
Thanks for the post. It gave me valuable added insights.
While the benefits of Asynchronous Tracking seem to make the change worthwhile, improved load times are an added benefit. Google has been saying page load times are or will be a factor in SERP rankings. I’ve seen cases of a page getting bogged down while loading GA code, so anything to improve that is going to help. Of course, as faster loading page is going to improve your user experience, and that’s really the core benefit here.
Now to find the time to update my site!
-Andy Commons