GA Checklist: The mighty Tracking Code

Article written by Claudiu Murariu

After creating a profile for your website in Google Analytics, the next step is to add the tracking code to your website. Google Analytics uses 2 different tracking codes: the old one, called urchin.js, quite limited in functionality and the new one called ga.js which Google continues to improve to higher standards quite frequently. My recommendation is to use or switch to the ga.js code.

The tracking code is customizable in order to fit the need of any website. It has 3 mandatory elements (the javascript file, the identification code and the tracker) and lots of optional elements. In order to make sure you’ll get accurate tracking when generating your tracking code you need to see what fits your website from the following:

  • Your website uses subdomains;
  • You use different domains for the same website (using this will also track subdomains);
  • You want to track traffic from mobile devices as well (for advanced users).

Google Analytics offers a great wizard on how to manage all of the above scenarios. (click the Check Status link in your website settings inside Google Analytics)

Bonus: Google has pushed the boundaries of the tracking codes and developed what they call asynchronous tracking code which will make the loading time for code much faster. It is in beta, but if you are an advanced user and have no problems in understanding javascript implementation documentation I highly suggest to give it a try.

Tracking your whole website

Most of the times I diagnosed websites for the presence of the tracking code I found pages that simply weren’t tagged. This is one of the main reasons for which many website owners get their own domain as traffic source in the referring sites report in Google Analytics, but we will get back to this later.

If you have a small website you can use one of the following free services on the web: SiteScanGa by Epikone or GPablo (haven’t tried this one).

If you have a large website, things can get a little bit more complicated or more expensive. One of the options you have is to purchase a Market Research licence for WASP. If you can afford it, I recommend it especially if you use other analytics providers than Google Analytics as well.

For the free but   a little bit more technical way to do this, John Mueller has a great tutorial for it.


Having your own domain as referrer? This is the issue that gets to be very frustrating. Most of the times it happens, as I said earlier, because some pages in the website haven’t been tagged. All the visitors that continue browsing the website after entering through those pages will be considered as referred by your domain, which technically is correct. Here are other situations when you get your own website as a referrer:

  • temporary redirects for entrance points in the website(302)
  • faulty cross-domains tracking
  • faulty encoding when passing referring sources data
  • session expiration issues (visitors forgetting their browser open with your page for more than 30 minutes)

This article is part of the Google Analytics Implementation Checklist series. Here are the articles from the rest of the series:

GA Checklist: The mighty Tracking Code by

1.100.000+ email leads collected with

PadiAct helps you get more email leads. More and better.