I want to add some tracking tools to my blog, just to know if someone is interesting in my posts. One of the tracking tools I decide to add was Google analytics – a really powerful tool that gives you a visual view on your site visitors, must viewable posts, traffic sources and much more. So I got into its site and registered my blog as one that I want to track for. Like all other tracking tools I just needed to add a piece of script code and everything supposed to work perfect. The script looks like this:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-XXXXXXX-X"; // My Account id
urchinTracker();
</script>
I added this script to the appropriate place but the data wasn't arriving to Google analytic site. So I started to look at the source code to check if the script was really in the place it should be. Than I saw the problem! There was another script that looked like mine, but with a different account id (My blog is a part of a Community Server, the community administrator added this tracking to all community blogs in high level). After a long search I found a solution to this problem. You must reset the "_uff" property before you register with the second account. It is an indication that tells the tracker to wait for others account registration before sending the data to Google analytic site.
The two accounts registration looked like this:
This javascript registration file will appear only once
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
The first account registration
<script type="text/javascript">
_uacct = "UA-XXXXXXX-X";
urchinTracker();
</script>
The second account registration
<script type="text/javascript">
_uff = 0; // Reset for second account
_uacct = "UA-YYYYYYY-Y";
urchinTracker();
</script>
And now everything works perfect!