Google Tag Manager – All your tags for your website in one place
As marketers we sign up for so many different tools from social media to analytics, can you honestly remember off the top of your head every tag you have inserted in your website?
The other day I noticed one of the websites I just finished building was running particularly slow and taking a while to load. I checked all the items I could, like seeing if everything was cached and minified, and finally I realized that the culprit was a script from Facebook that I put in my header to display a page widget on the site. I decided to move the script to the footer since I knew that would make everything that was really important render first without having to fire the script in priority over loading my content. Although that did the trick, looking thru my header had me thinking “wow there’s a ton of script and meta’s here from the different marketing and social tools that I use.” Half of them I couldn’t even remember what they were linked to without doing some digging.
I am surprised that I never used the Google Tag Manager sooner, simply because I am an avid user of everything Google; I am on the verge of becoming a Google Partner soon. Honestly, the only reason I know it exists is because of a tool I use called Ptengine that I was connecting at the time to get heatmaps for my website. When Ptengine gave me the tracking code to insert in my site, they had a little button that said something to the effect of “Add this with Google Tag Manager.” Of course I clicked right away and instantly fell in love. I have come to learn that organization is key in running a successful business no matter what industry you are in. When it comes to tags for your website there is no better way to organize and centralize them than with Google Tag Manager.
The simplicity of Google Tag Manager is what makes it vital to use. Instead of having a ton of different tags in your header, that could potentially slow your website down like my issue above, you instead have one tag (well technically 2) from Google that does the trick to fire all your tags for you when needed. So here is a step by step guide on how to use Google Tag Manager:
Create a Google Tag Manager Account
So you will to navigate over to the tag manager, just click here. The very first step is to create a new account, think of the account as an upper level basket that holds all the stuff that is related inside.
Hit continue so that you can setup your container. Think of your container as the website, application, or platform that is going to contain all of your tags. This guide is mostly written for those who need to add tags to their website, but still applies to the other container types. Add your container name and select the type of container that will be holding all of your tags. Then create your new account, of course you will have to agree to Google’s Terms.
Insert the Google Tag Manager Code in Your Website
Immediately after creating the account, Google will prompt you to install the Tag Manager script necessary to make all of this work. There will be two pieces of code: 1) a script that needs to go within your <head> tag and 2) a noscript that needs to go right below your <body> tag.
If using WordPress, be sure to paste this code into a child theme to ensure that it won’t get deleted upon updating your website. You can also paste it directly into your theme code, it just isn’t recommended in case you ever have to update one day. After that is completed, press OK and you will be redirected to the Tag Manager dashboard.
Adding a Tag into the Google Tag Manager
Adding a tag into the Google Tag Manager is a fairly easy task. On my website I currently have 4 tags added (Google Analytics, Ptengine, a meta tag for Google Webmaster Tools verification, and a Facebook script) with a bunch more on my list to be created and added soon. You will want to click where it says “Add a new tag.”
Make sure to give your tag a name at the top so that you can remember what the tag is for. After that choose a tag type. A lot of tags are supported by the Tag Manager already so look thru to see if your tag type is there and select the one you need. However, you can’t go wrong with just selecting to add a “Custom HTML” tag type. This will allow you to insert any type of code, meta, or script as a new tag.
Next you will want to select when to trigger the tag. For certain things like a Google Analytics Pageview tracking tag you would probably want to fire that tag on every single page to collect all the data from your website. The default trigger is all pages, meaning the tag is triggered with every pageview.
However, maybe you have a tag that just needs to be triggered on a certain page or event like a button click. In the upper right hand side of the trigger options you will find a blue plus sign. Click that to open up the other trigger options and create a type of trigger that you need. Again, don’t forget to name the trigger type in case you need to reference it again.
When you’re done configuring your tag you will be redirected back to your dashboard. Now you can see that you have added 1 tag, however the tag isn’t live on your website just yet.
Push the tags from the Tag Manager to your Website
Google Tag Manager is designed to handle teams adding multiple tags to a platform simultaneously. Therefore, tags are only live once they are actually pushed into production. This allows multiple team members to add tags, and to keep track of tag deployments by establishing a version history. In order to push your tags into production you will have to click the submit button in the upper right hand area of your dashboard, and detail the version of your recent deployment.
Be descriptive with your version history, especially if you work on a team in which multiple people will be reviewing and adding tags within the tag manager; you never know when you may need to revert to a previous version and then you are going to want to know what all was in that version.
Once you click publish, assuming the publish environment setting is set to “Live,” then your tag will be live on your website.
Like I said previously, not every tag is setup the same way. This tutorial shows you how to setup tags with the Custom HTML type because that type will pretty much work for any tag. However, some tags like Google Analytics tags are supported by the Tag Manager and have slightly different steps to setting them up. The general idea is still the same.
To add more tags all you have to do is repeat these steps. You can also add multiple tags before pushing your changes live.
Well I hope this information on how to use Google Tag Manager has been helpful to you, please contact me if you have any questions.