02
Jan
2010



Bookmark and Share

google_analytics

As stated by Google, on 2010 websites and blogs’ speed will be an important evaluation factor as far as ranking is concerned.  Google Analytics is important to know what is happening on your website  in order to know who and how many times your website is visited. However, its tracking  code slows the  page dowloading time a lot. Recently, Google has released a new tracking code (Asynchronous Tracking)  meant to solve this issue.

Asynchronous Tracking is a new fast tracking code. Reading from Google Code: “Asynchronous Tracking is an alternative way to track website visitors with Google Analytics. 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 Asynchronous Tracking requires a different Analytics snippet and a different syntax for making tracking API calls.”

What follows is the new code:

<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’;
(document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(ga);
})();

</script>

To start using it, simply remove the old code and place this new code right before </head> in your pages. Of course you have to change the UA-XXXXX-X with your own Google Analytics ID and that’s it!

If you want to know more, if you are looking for detailed instruction, read this guide.


Tags: , ,


Related ArticlesLatest Articles
.

Leave a Comment

If you want to show an image next to your comments, get your gravatar now!

This blog is moderated. Inappropriate comments will be edited or removed. Users posting offensive comments will be banned from this blog. Report Inappropriate Comments Here.

XHTML - You can use the following tags:  <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Copyright © 2007-2012 | Sitemap | Privacy | Back To Top
Best screen resolution 1280x800 or higher.
Web Talk is best viewed in Firefox.

Stat