5 Simple Ways To Debug Your Google Analytics Installation

As you might guess, we QA a lot of Google Analytics installs. It is often a maddening task that makes you want to “gaq.”

However, there are some nice tools that go a long way toward making life easier.

If you are questioning the data you’re getting out of Google Analytics; if your e-commerce reporting doesn’t match your sales; if you really thought there’d be more downloads of your whitepaper on the fonts used in movie credits; then you can use these tools to find out if Google Analytics is broken or if the error lies somewhere else.

This is how we do it.

Things That Go Wrong

Typos

Sometimes we just get things wrong. The Google Analytics developers site references some of the most Common Tracking Code Errors.

Fancy Quotes

We do a lot of our data collection in Microsoft Word. This means the IT departments of our clients are cutting and pasting our code from Word.

If you know what I’m about to say, you’ll have an evil grin on your face.

In its effort to be helpful, Word likes to add fancy quotes to everything you do. Microsoft calls these “Smart Quotes.”

We call them “Fart Quotes” as in “brain fart,” and they turn this:

'product category'

into this:

&rquo;product category&lquo;

You can turn them off after a Dante-like descent into the nine rings of Word configuration, as the MalekTips blog will demonstrate.

 

Wrong Google Analytics Account

We find all kinds of strange configurations when we start optimizing a website. Often, we’ll be granted access to a Google Analytics account, only to find out that a completely different property ID (as defined by the “UA-#######-#”) is being used.

 

mixed-accounts Viewing Page Source: Two accounts on one page.

Other Google Analytics Accounts

If you use a content management system like WordPress, you might find that some of your plugins also use Google Analytics. The most common one we find is the Disqus comments plugin, which you can only detect with some of the tools I introduce below.

View Source

The most common place to start for debugging your Google Analytics Tracking code is to simply open a key page and view the pages source.

In almost any browser, you simply right click on the page and select “View page source”:

view page source

 

Unfortunately, Chrome’s “Translate to English” option doesn’t help in this scenario.

Once you have the page open, you can search the page just like any webpage (Ctrl+F or F3) for some common Google Analytics strings.

  • Searching for “Google” will find the domain that the tracking code uses to download the Javascript files. It will also find all of your AdWords-related tags and code.
  • Search for “gaq” to find a common variable found in Google Analytics implementations.
  • Searching for “UA-” will help you find out the Property ID found in the tracking code.

You should try this on the following pages:

  • Your home page
  • Your PPC landing pages
  • Your “Thank You” or “Receipt” pages
  • Your shopping cart, registration process, or subscription process

Ghostery

An “easier” way to see if Google Analytics is on a page is to use the plugin Ghostery. There is a version for all of the popular browsers.

Ghostery Ghostery reveals that Google Analytics is on the page. It also reveals other tools that are installed, making it a great way to spy on your competitors.

 

In the image above, we can see that Google Analytics is installed on the page, but that doesn’t mean that the tool is installed correctly. We can also see that this site has CrazyEgg and Optimizely installed, two tools of the conversion specialist.

If you find these on a competitor’s site, be very afraid.

Generate Data & Look In Google Analytics

Once you feel that you’ve got Google Analytics installed, you can use the tried and sometimes-true method of simply logging in to Google Analytics and seeing if it is reporting data.

If you’re the only visitor to your site, this just might work. Otherwise, keep reading.

Firefox Debugger

I’ve just discovered this debugger for Firefox by Keith Clark, called GA Debugger.

I like the simplicity of this plugin. It shows what Property IDs you come across, which pageviews get generated, Events, Custom Variables and more, even if you navigate across sites. For those new to Google Analytics, you will like the hierarchy of the listing. It shows you how Events and Custom Variables relate to Pageviews in the system.

It doesn’t let you save a log of the data you collect, however, and this can prevent more detailed analysis.

GA Debugger Screen

Google Analytics Debugger For Chrome

Google’s debugger is only available as a plugin for the Chrome browser, but it provides the most detailed information of any of the tools I’ve found.

Google provides a debugging version of the Google Analytics Javascript code that generates messages for you as it works. This allows you to see exactly what is being written to your Google Analytics database, and what is not.

debugger-icon

Install the plugin and an icon appears in your extensions list bar. This extension works in conjunction with a built-in feature of the Chrome browser, called the JavaScript console, which you can open by clicking the “Customize and Control Google Chrome” button, and selecting the “Tools” menu. See the following figure.

Javascript Console, Column by Brian Massey

The information you collect is substantial. Every call is logged along with every parameter. The data collected by Google Analytics is also logged. You can see the Property ID, the URL of the pageview, the domain and referring URL.

You can also QA campaign information, such as source, medium, content and term.

You will be given information on Events, including Name, Type, Label and Value.

Your Custom Variables will be listed, complete with Label and Scope.

It’ll disclose what you are reporting to GA Ecommerce Tracking.

Google Debugger Messages, column by Brian Massey

Here’s a helpful tip: If you right-click in the console area, you can select the “Preserve log upon navigation” option, which keeps the console area from being cleared with each new page.

Preserve log upon navigation, column by Brian Massey

Now, you can cut and paste the contents into a text editor and use filtering and regular expressions to zero-in on just the information you want.

But, we’ll save that kind of analysis for another column.

Opinions expressed in the article are those of the guest author and not necessarily Search Engine Land.

Related Topics: Beginner | Channel: Analytics | Google: Analytics | How To | How To: Analytics | Search & Analytics

Sponsored


About The Author: is the Conversion Scientist at Conversion Sciences and author of Your Customer Creation Equation: Unexpected Website Forumulas of The Conversion Scientist. Follow Brian at The Conversion Scientist blog and on Twitter @bmassey

Connect with the author via: Email | Twitter | Google+ | LinkedIn



SearchCap:

Get all the top search stories emailed daily!  

Share

Other ways to share:

Read before commenting! We welcome constructive comments and allow any that meet our common sense criteria. This means being respectful and polite to others. It means providing helpful information that contributes to a story or discussion. It means leaving links only that substantially add further to a discussion. Comments using foul language, being disrespectful to others or otherwise violating what we believe are common sense standards of discussion will be deleted. Comments may also be removed if they are posted from anonymous accounts. You can read more about our comments policy here.
  • http://twitter.com/BruceBrownlee Bruce Brownlee

    We really like Web Analytics Solutions Profiler for crawling through pages in your site and checking which analytics are on board. I’m not thrilled that it costs money, but it does a great job. Checks each page you visit, sees all kinds of analytics and recording tools, Google Analytics, Marketo, Visistat, Quantcast, Clicktale, Crazy Egg, Scorecard, and so on. It has a crawl tool as well. But most handy is that it grabs UA numbers and shows them so you can see at a glance if you made a mistake.

  • http://twitter.com/bmuttenzer Beat Muttenzer

    For the less experienced the Chrome Plugin Tag Assistant by Google (https://chrome.google.com/webstore/detail/tag-assistant-by-google/kejbdjndbnbjgmefkgdddjlbokphdefk) might be helpful. It shows you the Google Tracking Codes (Analytics and AdWords) you have implemented and gives suggestions on how to improve the implementation.

  • http://www.dee-ess.com/ Devendra Singh

    I would recommend to use Gifhit (gifhit.co.uk) which is based on Fidler core api. I use it the most for GA implementation debugging. It gives very userfriendly explaination of each values being passed to GA servers including custom variables, events and page speed data.

  • RAHUL DIXIT

    Can I track visitor of my google+ page and facebook pages using GA? If yes then please give me proper and simple guidence. Thanks in advance

  • http://conversionscientist.com Brian Massey

    Great tip, Bruce. It didn’t quite pass my bar of “simple,” though it isn’t necessarily complex.

  • http://conversionscientist.com Brian Massey

    I agree. Thanks for mentioning this.

  • http://conversionscientist.com Brian Massey

    This is new to me. Thanks for sharing.

  • http://conversionscientist.com Brian Massey

    Rahul, I’m not aware of any way to track G+ and Facebook visits in GA. Sorry.

  • Lars Skjoldby

    I can also recommend this free and simple scanning tool: http://www.gatective.com/. It finds pages where the tracking code is missing.

  • Pat Grady

    Also often find things very gaq’d up. Thing is, this doesn’t seem to stop people from finding “good” insights. :-)

  • http://www.searchinfluence.com/ Chelsea Bowling

    The GA debugger extension for Chrome has saved me more times than I can count, so I’m glad you brought it up! I’ll check out the FF plug-in as well. Also agree that smart quotes are quite evil. Tangentially related is WP’s tendency to eat code on pages and posts, unless it’s built into the template– not usually a problem, of course, but sometimes it crops up with quickly-down thank you or landing pages and Adword’s conversion codes.

  • Rajesh Magar

    Incredibly awesome. Special thanks to make me introduced to myconversionlab.com and so you too (Conversion Scientist).

  • http://conversionscientist.com Brian Massey

    Lars, I’m checking this out. If it proves helpful, I’ll add it to http://www.myconversionlab.com. Thanks!

  • http://conversionscientist.com Brian Massey

    Rajesh, I’m glad it was helpful.

  • http://conversionscientist.com Brian Massey

    Chelsea, I have been the victim of WordPress’s code munjing many times. Thanks for the comment.

  • http://conversionscientist.com Brian Massey

    Pat, maybe Google should have used a variable name like “_qood” instead of _gaq.

  • Yehoshua Coren

    I’ll chime in and say that http://www.analytics-debugger.com/en is a really great tool as well.
    Also, in terms of scanning source-code, my favorite tool is http://www.screamingfrog.co.uk/seo-spider/
    It is worth noting, that with the proliferation of Tag Management Systems, that simply viewing / scanning source-code is not nearly as useful as it used to be. As a result, I usually use tools like Analytics Debugger (above), Tag Assistant (a chrome extension by Google mentioned in the comments already), Observe Point, or Fiddler.

  • http://conversionscientist.com Brian Massey

    Yehoshua, great points. Thanks for the pinters to Fiddler (http://www.fiddler2.com/fiddler2/) and Observe Point (http://www.observepoint.com/). Tag managers tend to interfere with our split-testing software, so we are stepping into them slowly.

  • Guest

    I think this is possible with Colibri. Here’s the link: http://colibritool.com in case you need it

 

Get Our News, Everywhere!

Daily Email:

Follow Search Engine Land on Twitter @sengineland Like Search Engine Land on Facebook Follow Search Engine Land on Google+ Get the Search Engine Land Feed Connect with Search Engine Land on LinkedIn Check out our Tumblr! See us on Pinterest

 
 

Click to watch SMX conference video

Join us at one of our SMX or MarTech events:

United States

Europe

Australia & China

Learn more about: SMX | MarTech


Free Daily Search News Recap!

SearchCap is a once-per-day newsletter update - sign up below and get the news delivered to you!

 


 

Search Engine Land Periodic Table of SEO Success Factors

Get Your Copy
Read The Full SEO Guide