Yesterday I described The Many Elements of Web Site Speed. There are many variables that can be fine tuned to add more speed. Some have a small effect, others have a big effect. Today I want to talk about one change that can simplify maintaining a site while also adding speed. Is it a huge speed boost? Probably not, but every little bit helps.
Most Web sites have at least some way to track the traffic on the pages of their site. One of the most popular is Google Analytics. Each of these trackers requires a few lines of codes on a Web site. Often sites will have more than one. We currently use three on our sites, and each snippet of code is reaching out to different servers. Should we need to change the code, we have to change it on each of our eight sites.
That’s where Google Tag Manager comes into play. It allows you to add each of the tracking tags in a single location and it then provides a single piece of code to load all of the tags from Google’s server.
The screen shot above is from the screen where you add tags. Google Analytics is the first option listed and many of the other popular services have a built-in wizard. If your service isn’t listed, just use the Custom HTML Tag and put in the snippet of code. One of the benefits is that you can come back to Google Tag Manager (GTM) to change any of the tags and those changes will automatically be pushed to all sites using the GTM code. This is great for managing these tags on our eight sites.
Another benefit is more speed as each of the scripts within the GTM code load asynchronously so the rest of the elements on the page don’t have to wait for them to complete. As soon as I switched our tracking tags to GTM, I noticed the each of the sites loaded faster. Not all of our sites have been updated as I write this, but this will likely be updated by the time you read this post.
If you want more details on how to implement it, read the excellent tutorial on RazorSocial entitled Google Tag Manager: An Essential Tool for Website Activity Tracking.