If you’ve looked into setting up Google Analytics before or you’re working with us, you’ve probably heard of Google Tag Manager. In today’s blog, I’ll explain what Google Tag Manager is, why it’s important and run through how to use it to setup a basic Google Analytics tag.
Google Tag Manager (GTM) is a platform that allows you to deploy and update marketing or measurement tags on websites with minimal changes required to the site. In practical terms, this means that, once installed, Google Tag Manager allows you to quickly and easily setup website tracking, reducing the back and forth between marketers and developers that can delay these deployments. It’s most commonly used in conjunction with Google Analytics (and is one of the preferred methods of implementing it), but can be used with other services such as Facebook Pixels, Google Ads Remarketing and Conversion Tracking.
As an example of what Google Tag Manager can do, I recently deployed a tracking scheme on a client’s website, including tracking conversions for Google Analytics such as Link Clicks, Form Submissions, PDF downloads and Video Plays, while only adding the GTM snippet and less than 10 lines of code to the website itself.
Google Tag Manager works off of Triggers and Tags, with Variables used to support both:
The basic process of firing a tag in GTM is as follows:
Setting up Google Tag Manager on a website is simple and just requires cutting and pasting two bits of code into your website’s header and body. It’s very straightforward, but if you’re uncomfortable with your website’s code, you can ask a developer to do this for you.
In the example below, I’ll show you a simple way of adding the GTM code snippet on a WordPress website:
1. Firstly, you’ll need to head over to Google Tag Manager. If you don’t already have an account, create one with a Google Account. Once you’re in GTM, click Create Account in the top right, then fill out the details. Make sure to choose Web as your target platform.
2. After creating the account, you should be prompted with two code snippets. You’ll need them later, so you can either save them now or come back to them later (you can find them under Admin -> Container -> Install Google Tag Manager).
3. Once you’ve created the account, go ahead and publish an empty container by clicking Submit in the top right and then Publish again. If you don’t publish a container, you’ll receive a 400 Bad Request error message later when testing. Once you have published, enter Preview mode by clicking the button next to Submit.
5. You can now test your installation by refreshing your website. If you see the GTM Debug Panel at the bottom, your installation has worked!
Now I’ll show you how to deploy the Universal Analytics tag. This will replace the Google Analytics .gtag that you may have been using if you had already implemented Google Analytics without GTM.
Using Google Tag Manager for the Universal Analytics tag is just the very basics of what Google Tag Manager can do for your website. I encourage you to play around with triggers and tags to see just what’s possible within GTM.
With GTM, you can more accurately measure the user behaviour across your website and gain better insights on your website’s performance. At more advanced levels, you can even track what items in an online store are being viewed the most and how far down your purchasing funnel customers are getting. If you want something measured on your website, then Google Tag Manager can probably do it.
If you have any questions about Google Tag Manager or any topics you want explored, drop a comment below or give us a yell on Twitter, Facebook or Linkedin.