Google Tag Manager (GTM) is a free service by Google that is used to configure different analytics, conversion tracking and remarketing pixels (Universal Analytics tracking code, Facebook pixel, AdRoll pixel, etc.)
If GTM is not used all these codes and pixels should be added to the source code of the website. This approach makes it very difficult to implement the pixels (only technical team can do this), difficult to debug (tools are available only for few systems like facebook, twitter and bing) and difficult to update (source code changes are required).
GTM simplifies these processes because GTM code is added to the source code of the website only once and all the further configuration is done in web interface on googletagmanager.com.
The configuration created on googletagmanager.com can be previewed, debugged and published when ready from the web interface.
The image below illustrates how GTM works:
Succinctly speaking, Google Tag Manager collects different data points (variables) from web-pages and sends them to different analytics, conversion tracking and remarketing systems (tags) when some events like clicks, form submissions, transactions, page views, etc. happen on the websites (triggers).
GTM Implementation Steps
Step 1: Create GTM container and implement it on the site
Creating GTM container is very simple. You need to go to googletagmanager.com, sign in to Tag Manager with your Google account and follow the steps there to create the container for the type of content Web.
If you have any trouble (normally you will not) with it you can check the docs here https://support.google.com/tagmanager/answer/6103696
During container creation process you should get the installation code. It looks like this:
The red placeholders contain the unique id of your GTM container.
If you have skipped this step for some reason you can always click on your GTM id link in Google Tag Manager interface (googletagmanager.com) site and get this code:
The developer should add the two code snippets on every page of the website as explained in the instructions (one snippet should be places in <head> section and the other one in the <body>).
You can use Google Tag Assistant to check if the code is implemented correctly
Important! You should ignore "Invalid or missing account ID" error for new 7-digits containers. It is a known bug in Google Tag Assistant)
You can use http://www.gachecker.com/ to verify that GTM is installed on all the pages.
Step 2: Configure Tags in the GTM container
Before working on configuration it makes sense to create a measurement plan or a list of events that should be send to Google Analytics, Facebook and other systems.
Here you can find more information on what is a measurement plan and how to create it http://www.kl82.com/services/analytics-measurement-plan
When you have a clear idea of what you need to track you can go to googletagmanager.com and start configuring your variables, triggers and tags.
While working on configuration you can run your GTM in preview mode. When you are in preview mode you will see the following panel at the bottom of your website:
This panel contains information about your tags, triggers and variables. It gets updates when new events happen on your website and new tags fire.
When in preview mode the current version of GTM is working for you but not for other users.
Step 3: Publishing the GTM container
When you are happy with your GTM configuration it is time to publish the container.
But before publishing you should remove Google Analytics and other codes and pixels that you have configured in GTM from the source code of your website.
If you do not remove it the Google Analytics and other codes and pixels will work together with codes and pixels in GTM as on the image below:
On the image you can see that Google Analytics and Facebook gets data from GTM and from the site directly. So each event is tracked twice. Every time someone visits a page a pageview hit is send to Google Analytics and Facebook from GTM and from the website directly as if the user has visited the page two times.
Because of this you will have twice as much pageviews, events and other hits as you really have along with unrealistically low bounce rate. To avoid this situation make sure you have removed Google Analytics tracking code and other pixels that are implemented in your GTM container from the website.
If you need to make any changes to your GTM configuration later you can make changes, preview and debug them as explained in step 2 and publish when you are happy with the new configuration. Every time you publish your GTM a new version of the container is created and you can republish the old configuration if you wish.