Google Tag Manager is a marketer’s best friend. It’s the go-to solution for adding tracking codes, pixels and scripts to your website.
Adding them manually through plugins or directly into your HTML may seem the obvious way to go. But when they start to pile up, managing them can quickly become a tedious task. You’ll need to test them manually and update them when a new version comes out.
What’s more, the more code you add to your website, the slower it loads. For more details on how page speed can impact your performance, check out: How To Optimize Your Page Speed For Conversions And SEO
Luckily, Google Tag Manager helps you to manage all of your tags in one place efficiently. So instead of you rushing to the IT department to add a Facebook Pixel to your website and waiting until to gets added to the sprint – you can just add it by yourself.
To get started with Google Tag Manager, you’ll only need to install one piece of code on your website. Here we guide through our Google Tag Manager tutorial to show how to setup and install it.
How To: Google Tag Manager Tutorial
1. Create an Account
Head over to Google Tag Manager and sign in, using the same login credentials as your Google Analytics account.
Once you’re in you’ll want to create an account inside Google Tag Manager.
Each account contains a container ID for your site. When setting it up, you need to pick which container you want (Web, iOS or Android) and then press “Create” to get your Google Tag Manager installation code.
2. Create a Tag
Once your account and container are created, you’ll want to add tags by hitting the “New Tag” button.
In most cases, the first tag you need to add is Google Analytics. Here you’ll need to click on the pencil icon to add Google Analytics from the list.
3. Adding Tracking ID
Next up you’ll need to add your Tracking ID into the field. You can do this by clicking on “Google Analytics setting” and then choosing “New variable…”
From there, you’ll need to add your Google Analytics tracking ID to link it to your Google Tag Manager.
4. Choose What to Track
After you’ve put in your Tracking ID, you’ll want to specify what you want to track and when the tag should fire.
For Google Analytics, use “All pages” so that you’re tracking every page view on your website.
5. Add Google Tag Manager to Your Website
Now you’ll want to install and activate Google Tag Manager on your site.
If you’re using WordPress, then the easiest way to do this is through a plugin. The Insert Headers and Footers plugin from WPbeginner will do the trick.
Once activated, head over to Settings » Insert Headers and Footers and paste your Google Tag Manager code in “Header” and “Footer” sections.
Alternatively, you can also insert the code directly into the theme files of your website in the <head> section and after the opening <body> tag.
6. Publish Container
Once you’ve inserted the code on to your website, you can preview it first to check your tags are firing. But you can also publish the container immediately if you like.
7. Confirm Google Tag Manager is Working
When you’ve published your Google Tag Manager container, it’s always a good idea to be on the safe side. So you’ll want to make sure your tags are sending data back to you.
For the Google Analytics tag, log into your account after a couple of days to see whether you’re registering page views.
And that’s it. You’ve successfully completed the Google Tag Manager tutorial and got it set up on your website with Google Analytics.
Are you using Google Tag Manager? What has been your experience? Let us know your thoughts in the comments below.