Three Common Troubles With The New GATC

December 17, 2007


There are always a few problems when you’re doing something brand new. I’d like to quickly outline a few of the issues we have found while working with the new GATC. Two of the three issues listed here are merely a result of a documentation error on Google’s support site. I’m sure it will be quickly resolved, but until then you should avoid pasting this code directly into your webpages.

 

Smart Quotes

The first problem is the use of directional quotes (smart quotes) in the code that Google asks you to copy onto your webpages. These are the quotes that face one direction at the beginning of a quote and the other direction at the end of a quote. It is an easy oversight to make, but web browsers are not so forgiving. Whenever you see this type of quotes, make sure you overwrite them with straight quotes in an application such as Notepad before using the code on your website.

3 problems

 

Dynamic http/https handling

Dynamically handling either an http or https version is a great idea, I really liked seeing it in the new GATC. However, it has been suggested a few times that this code doesn’t fully comply with XHTML standards, which can cause some problems. Replacing the dynamic code with a reference to just one version or the other should work just fine until things get sorted out. For Example:

<script type=”text/javascript” src=”http://www.google-analytics.com/ga.js”></script&gt;

Wrong Function

During development, names of functions and variables can change and it’s hard to be sure every change propagates to every document. The function _trackVisit() doesn’t actually exist in the ga.js. So,instead of

        pageTracker._trackVisit();

use

 	pageTracker._trackPageview();
 

and you’ll be fine.

 

The End (for now)

I’d like to note that all of these issues have already been addressed in the Google Analytics Help Group by several people, including ShoreTel whose patience in answering the same questions over and over deserves some recognition.