If you use google analytics to track your sites, google has a released a new tracking code that will take advantage of browser support for asynchronous JavaScript to enhance the speed in which is loaded.
With the new code, simply insert the code at the bottom of the </head> section.
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
Replace _setAccount
method with your web property ID.
My recommend and simplest way of solving this solution, is to install the Platinum SEO wordpress plugin and once installed visit the plugin admin panel and insert the code in the fields : additional post headers, additional page header and additional home headers.
Related articles by Zemanta
- Tracking Events And Goals With Google Analytics Asynchronous (619cloud.com)
- RequireJS: Asynchronous JavaScript loading (ajaxian.com)
- Google’s New Asynchronous Code (epiphanysolutions.co.uk)