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.
- 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)
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 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 Claudiu Murariu