I decided to write a post about the Google Analytics code, primarily for people new to the web analytics world. Even if this a very old topic that has been exhausted by various renowned bloggers, I realised that a lot of people still struggle to understand the basic differences between Google Analytics tracking code versions.
Hopefully in this post I will clarify the main differences and modifications that you can do to your Google Analytics code, when to use each version, and what you’ll get in return. I will also cover how to do the same modification with Google Tag Manager. If you do not know what Google Tag Manager is, Google recently released a series of videos that will help you understand the basics.
I will not go through the old school Urchin.js code, and dive directly to the codes you are most likely to see in various web sites today.