Monday, September 19, 2011

2 Google Analytics Codes On One Page

This is a short heads up that if you plan on putting 2 google analytics codes on one page, you will most certainly affect the search engine ranking of your site.

In the course of optimizing a client's site, I was perplexed to see link referrals in his Google Analytics from the most obscure of places. In fact it just didn't make any sense. The site I was working on had no relationship whatsoever to the sites that were linking to his site.

After some head scratching, I inquired if this person owned other web properties. Lo and behold, the referral links were from another site owned by my client.

I quickly checked the source code to see if there was more than the one Analytics code there. Bingo! 2 Google analytics codes on one page were placed throughout the site on every page.
It seems that in the course of building his non-ranking site, he had used a template of another site and had forgotten to remove the original Analytics code from the template.

I quickly removed every duplicate Analytics code and was amazed how quickly the site's position had changed in the search results. In fact, within two days, it was in the number one position for it's main keyword phrase.

It seems Google can be very heavy handed and yet forgiving at the same time. One can only wonder how many sites may be suffering, when a genuinely unintentional error is made during the construction of a website.

More telling is, that if you plan to sign up to Google's Analytics program, make sure you've read and abide by every one of Big Brother's guidelines. It seems Google hasn't figured out or isn't willing to advise its Analytics participants with an immediate popup message reading "BEWARE - really stupid errors on your site."


No comments: