GTM Key Concepts Simplified (set it up like a pro)

Avatar Arpit Khurana | January 30, 2018

Learn How To Setup Google Tag Manager Like A Professional.

Hi, guys my name is Arpit and  today we are going to talk about 3 important concepts regarding Google Tag Manager.

In case you are trying to setup Google Tag Manager for your website. This video will be really helpful for you. So let's get started.

The first important concept is container.

You can think of a container like a bucket which keeps all your tags, triggers, variables and macros. I will explain tags, triggers, variables and macros in my later videos.To set up a container for your website go to Google Tag Manager and then click on sign up. Under account name you can put your company name and then click on continue.

Under container name it is a good practice to put your domain name, like in my case it can be be, then select the type of content web, amp, ios or android. If setting up a mobile container, select whether you are using the Firebase SDK or one of the Legacy as SDK

For a website, simply select web, click create, review the terms of service and click yes if you agree to those terms.

When your new container first loads, you will be prompted with the web container installation code snippet. Paste this code as high in the head of your page as possible. Additionally paste the below code immediately after opening the body tag.

Like you see in my website. If, I show you the source code of the homepage you'll see. The first Google Tag Manager code being pasted as soon as the head tag starts and then you can also see the second Google Tag Manager code being pasted as soon as the body tags starts.

Now your container setup is done.

You can add Google Tag Assistant to confirm that container has been set up correctly. If you see green here then you are good to go. Otherwise you might see some errors here.

GTM also lets you import containers, you can import a Json file through which you can import tags, triggers and variables into your container. You can also create multiple containers, however it is strongly recommended that you just create one container for one property.

The second important concept is of Workspace.

Workspace enables different users and teams to work independently to develop and test different tag configuration, workspace helps you in version control by enabling you to roll back certain changes It also prevents teams from unknowingly publish each others changes.

To create a new workspace. You can click at current workspace or you can even click on settings and then manage workspace this will also bring you on the same speed to create a new workspace.

Click on this add icon to give your workspace a logical name so you can keep proper track when you go ahead and publish this workspace as a version. One good way of doing this is to start with your present version number followed by the feature implemented in the workspace followed by the team working on the workspace.

For example - In the version no 7, the feature implemented is facebook pixel tracking and the team working is social media team. Then you can describe this workspace and save it.

Now remember, you guys can only create three workspaces so you will have to delete them once a given task is over. You can switch between workspaces very easily also you can delete them after your workspace is done. You will see the changes here.

In case everything is good and you want to publish this workspace. Then click on submit. Now here you can see the version name as your workspace name and that is why it is necessary to follow a naming convention as explained before.

The third Important concept is of environment.

Environment is a great feature that enables you  to test your changes before you publish them to a  live server. You can set up multiple environment servers in Google Tag Manager.

If your website uses a quality assurance process as it should or if you test your changes on a staging server before you publish them to a live server then you should set up an environment corresponding to each server for your website in Google Tag Manager.

In order to create an environment. Click on admin and then on environments. By default you see two environments here live and latest. These cannot be deleted or published to manually. It is recommended that you create custom environment.

A common naming convention for environments is as follow. I suggest you to create three environments.

First - Dev, this environment is what you and your team use for day to day website development

Second - Quality Assurance, an environment that is used for quality assurance testing. Policy might be set such that all changes must pass through this environment before being published to live.

Then finally live environment

This environment will host a live version of your website.The version that is visible to your users. Once you have your naming convention established, you can set up custom environments in Google Tag Manager.

Click new. Enter a name for your environment with a description. Always check enable debugging by default enter the url for your live website, click create, your new environment should appear in custom environments listing. Like I created an environment here QA..

The next step is to paste the code snippet for each environment against the corresponding server for your website.To do this click on actions and then get snippet. Now this is the code that you need to paste against each corresponding server.

For your website the process for installing the code is same as a container which I have explained earlier in this video. Now, when you publish a version you can simply choose the environment in which you want to publish this version. This is really very convenient guys.

That be all for today's video. Stay tuned for more GTM tutorials.

If you guys want to learn anything in Google Tag Manager, let me know in the comment section. Like this video also, subscribe to my channel for more amazing digital marketing videos.

Bye for now. I'll see you guys soon.

Written by Arpit Khurana

  • Copyright ©2019 NSDM INDIA. All rights reserved.