A Practical Guide: How To Setup Google Tag Manager

Google Tag Manager was created by Google to make it easier to add, edit, and remove tags and code snippets on your mobile app or website without needing the help of a developer. This includes site analytics, event tracking, conversion tracking, remarketing, and more. In Google Tag Manager (GMT), you can add or update Google Analytics, AdWords, custom tags, or 3rd party tags without needing to edit the code on the website. This was welcomed by everybody (especially by marketers) as doing it by yourself was highly technical and it required dealing with log files and potential errors.

What Are Tags?

A tag is a JavaScript code that is used to collect marketing data and various measurements data from your website which is then sent to 3rd party services. The third party service could be Google Analytics, Facebook, Google AdWords, Twitter, etc. Examples of tags would be phone call tracking codes, Facebook pixel code tag, Google Analytics tracking tag, etc. Is just a snippet of code that you add directly to your website in your website template file (like header.php), or to make it easier for you, you simply add it via Google Tag Manager.

Advantages Of Using Google Tag Manager

GTM decreases your website maintenance cost because you don’t need to depend on an IT person for doing tag related tasks. Google Tag Manger is also completely free to use, there are no monthly or yearly fees.

With Google Tag Manager, there’s no need to edit the website code anymore if you need just to add, edit, or remove tags. Instead, one piece of code is added to every page on your website, called GTM container code. This code acts as a literal container in a way that it can store multiple tags. Then through GTM interface, you can enable, disable, add, edit, or remove your tags with just a few clicks.

GTM remove the need to hardcode the tags every time when you are working with them on your website so you can test and deploy them very quickly. Marketing conditions change, as well as social media and search engine landscape do, so you need to be able to adapt rapidly. You don’t want to spend days or weeks just to add some tags on your website because you have to wait for your IT person. A major problem for online businesses is that they are over dependent on their web developer team for tasks related to website code. When you start using GTM, you can do any tag related task in minutes.

Google Tag Manager makes it possible for you to utilize advanced analytics tracking. Many in-built tags and variables come with GTM so you can implement advanced tracking quickly. This task would usually require a few days or even weeks when done without GTM. For example, if you need to track clicks on specific “submit” buttons on your pages, you can do this in a matter of minutes. Otherwise, you would have to deal with adding event tracking code on every submit button on your website, and that can be very time consuming but also result in many errors.

Managing existing tags is very efficient with GTM. You do all tag related tasks from one central position. This comes in very handy when you have dozens of analytics and marketing tags on your website. Also, when you implement tags via GTM, they are deployed asynchronously, so you can actually improve website speed since there will be no slow loading tags that block other tags from being executed.

Creating Google Tag Manager Account

Start by going here https://tagmanager.google.com/. In order to create a GTM account, you’ll need to have a Google account already created. If you need multiple GTM accounts, then you can make them from a single Google account. Best practice is to create one GTM account per company or a website which will hold all tags that you have. If you are running a single website, then you’ll need only one account.

Name your GTM account after your company and the tag container after the domain name. If you manage multiple domains, then you need to set up one container per domain. There’s an exception and that is when the tags on one website span more than one domain, then you can set up just one container that will cover all the domains involved. If you need to apply tag changes only on one domain and don’t want other domains to be affected, then you should use a different container for each domain since all changes go live when you publish a container, regardless of domain.

If all your tags are basic and are firing as pages are loading, then a basic container usage may be sufficient. In this case, you can place the provided container snippet (it’ll be generated when you create the container) on all the pages you have after the first <body> tag.

Google Tag Manager Container Tag

The container tag makes it possible for you to run and deploy any tag on your website. You can easily edit the container tag via a simple user interface. Actually, when someone refers to Google Tag Manger, they might be just referring to the container tag. GTM container tag is made up of two parts. When you log into your GTM account, then you can get the container code by following these steps:

  • Step 1: Go to https://tagmanager.google.com/ and log-in or create an account
  • Step 2: Click on the “Admin” tab
  • Step 3: Click on the “Install Google Tag Manger” link
  • Step 4: You will see the container tag code. You’ll need to copy and paste the first part of the code in the <head> section on all pages and then copy and paste the second part of code right after the <body> tag on all pages as well.

Once this is done, then Google Tag Manager is installed on your website. So basically, you can look at Google Tag Manager as the container tag. One more thing, after you added the container snippet to your website, you’d want to migrate any existing tags (like AdWords tags) from your website into GTM. It would be best to migrate all of your tags, although Google Tag manager will work fine alongside any existing tags. To make sure that installation went well, you can use the Tag Assistant Chrome extension.

If you need to create additional containers (for another website), then in Google Tag Manager, select an account and click “Admin” in the top bar. Locate the “Containers” dropdown menu and choose “Create Container”. You’ll be prompted to enter a name and to select what you will use the container for, in your case is “Web”, then click “Create”.

Tag Templates

When you log-in to your GTM account, you can see dozens of tag templates that are already provided. They make it very easy to deploy tags on your website. You can also create your own tag by clicking on the “Custom HTML tag” or “Custom Image Tag”.Go to “Overview” then click on “Add a new tag”. You can also see all available tags like on the image below.

Next, click on “Tag configuration” and you’ll see a list of tag templates:

Triggers

Once you add some tags, then you will be prompted with some details that you need to fill in for each tag type. On this screen, you can also add a trigger to fire that tag. On the image below you can see “Fire On” section. This section defines the triggers that will be used on individual tags. If you want this trigger to fire on all pages then leave it selected like on the image. If you need to add tag only on the certain page, e.g. thank you page, then you can select “Some Pages” and enter page URL.

To put it simply, the trigger is a condition which must be met in order for a tag to fire or not fire. Triggers are an integral part and you can’t create a tag without first creating a trigger. To create a trigger, you can do it either through the triggers menu or when you are creating a new tag. The important thing to remember is that there are two types of triggers: firing triggers and blocking triggers.

  • Firing triggers: this is a condition which must be met for a tag to fire. This tells GTM when the tag should fire. For example, firing trigger can be when the URL of a page matches the exact specific page on your website, so the tag will fire only when someone opens that exact page. A common example is the thank you page after a purchase. Create a trigger through “Triggers” link in the main menu and then click the “New” button. You will see a list of triggers that are built-in and just choose one that you need.
  • Blocking triggers: here you are setting a condition that must be met in order for a tag to not fire (execute). The process to create it is the same as for creating a firing trigger.

Variables

A variable is a function which is called within a tag, trigger or a variable. A variable tells Google Tag Manager where to fire a tag. For example, you can make a variable that will fire the tag on any thank you page.

You can select a variable in any text field when is available. Is shown as a button on the image. So, a variable stores data that is then used to define a trigger or pass information (like Google Analytics account ID or product price) to tags.

There are some built-in variables in the GTM that can’t be customized and you can access them in the “Variables” menu where you’ll see a list of built-in variables. You can activate all built-in variables so that they are available to you at all times. Besides these, you can always make your own variables which are called “User defined variables” which you can create in the same main “Variables” menu.

Folders

Folders are a neat way to organize tags, variables, and triggers. For example, you can group all tags and variables related to affiliate tracking by creating a corresponding folder and then add all related tags, triggers, and variables to it. Here’s how to do it:

  • Go to “Folders” in the menu
  • Click “New Folder” and enter a name for this folder. On the next step you can simply check the boxes for all variables, tags, or triggers that you want to add to that folder.

Publishing & Versions

Tags are not automatically published when you add them to a container, rather they must be manually published. If you click on “Versions” at the top of the interface, you will see a summary of your current container version and you can see “Action” button on the right to preview, share, publish, export, etc. You can use this screen to track your change history as well.

If needed, you can also give certain users different levels of permission in the Google Tag Manager. You can change this in the “Admin” section in the top navigation bar. There are four basic types of user access:

  • No access: user doesn’t see the container
  • View only: user can’t edit anything but can browse
  • View and Edit: user can view and edit tags, rules, and variables
  • View, Edit, Delete and Publish: user may view and edit everything, but also publish changes to the live site

CONCLUSION

As you can see, Google Tag Manager can help you to set up tags for basic page view information, all the way to very advanced things like e-commerce tracking. It can be a bit overwhelming when starting to use it, so take it step by step. Google has a very in-depth help section on all things related to the GMT, so you can check there if you get stuck. Any time is a good time to migrate to Google Tag Manager so you can take advantage of its many awesome features.