You are wondering how to add Google Analytics to Google Tag Manager and start analysing your website. Go no further, you’re on the right page.
In this tutorial, we will see step by step how to set up Google Analytics and configure Google Tag Manager so that the tools work together.
We will start with the installations of Google Analytics and Google Tag Manager.
Then we will configure a first Google Analytics tag with Google Tag Manager.
At the end of this tutorial, you will have a configuration of Google Analytics with Google Tag Manager ready for further integration with other marketing tags.
You might even say: “The setup of GA with GTM was easy“
Table of Contents
Google Analytics setup
If you have a website, this is the very first thing you have to do – setting up Google Analytics.
Google Analytics is a free tool (and you can pay for advanced features), and it will let you analyze the traffic of your website and the behavior of your visitors.
The key features of Google Analytics are articulated around:
- Audience: Understand who are your website visitors
- Acquisition: From where the visits are coming
- Behavior: How do the visitors behave on your website, how is their flow through the pages
- Conversion: Measure the impact of your actions
You continue demystifying Google Analytics, and learn more about the features in this article, or follow up with the tutorial.
Get Google Analytics Tracking ID property
To track the visits on your website, you will have to set a simple piece of code on your web page. This code is the Google Analytics Tracking ID. To get this code, follow the following steps:
- Create a Google Analytics account
- Select Website (by default)
- Enter an Account Name, Website Name and Website URL
- Click on Get Tracking ID
Once you see the screen below, simply copy and paste this code in the <HEAD> of every pages you want to track.
Test Google Analytics installation
The best way to test your installation of Google Analytics is to extend Google Chrome with the Tag Assistant.
Tag Assistant is a test tool and helps to troubleshoot the installation of multiple Google tags, including Google Analytics, Google Tag Manager, and more. We will need it again later in this tutorial.
To check if your analytics tag is properly working, click on the Tag Assistant extension in your web browser.
Great. Now you are setup with Google Analytics. Let’s move on with the installation of Google Tag Manager.
Getting started with Google Tag Manager
It is often a question asked by people: What is the difference between Google Analytics and Google Tag Manager? Can I use both of them?
The simple answer is: Yes, and you should use both.
With Google Tag Manager (GTM), you can manage all your marketing tags (snippets of code, tracking code) in one single place and deploy them to all your website with few clicks.
Once you Google Tag Manager is installed, you won’t have to call your IT service to modify the code of your website anymore. You will setup marketing tools that work with tags, such as your web analytics, or your marketing automation on your own.
Google Tag Manager offers powerful features such as
- Tag: Create any Marketing Tag and use the various integrations already existing.
- Trigger: Define when your tag should get executed.
- Versions: Define several versions and deploy them to different websites.
You can get more details on the main features of Google Tag Manager here.
Google Tag Manager setup
In the following steps, we will install Google Tag Manager and then configure the first tag with Google Analytics. Indeed, Google Tag Manager, by itself, is an empty shell.
Let’s start the installation of GTM:
- Create a new Google Tag Manager account
- Enter an Account Name, and Container Name
- Click on Create
A popup window is inviting you to copy a piece of code on every page of your website. Follow the instruction.
Take care, and copy exactly the two piece of code on every page in the <HEAD> and in the <BODY>. It is not optional.
Test Google Tag Manager installation
We will use the same method than with Google Analytics. Go back to your website and click on the Tag Assistant in Chrome.
The Tag Assistant should display a yellow icon. Don’t worry; it is just telling you that the container is empty.
In the following, we will see how to connect Google Tag Manager to Google Analytics.
Install Google Analytics with Google Tag Manager
Are you ready to set up Google Analytics in Tag Manager?
Are you ready to install your first tag with Google Tag Manager?
Yes, your first tag! Google Analytics is a tag inside Google Tag Manager. In other words Google Tag Manager is containing Google Analytics.
After these great explanation, let’s start the configuration.
From the main screen follow these steps:
- Click on Add new a tag, and a new window will popup
- Select a name, as an example “Google Analytics“
- Click on the tag configuration area, and chose the type of tag Google Analytics – Universal Analytics
- Leave the track type on Page view
- Then pick a setting variable. (If it is a brand new container, you should have no variable. )
- Create a new variable Google Analytics Settings and name it “GA PROD“
- Enter the Tracking ID of Google Analytics (UA-XXXXX)
- Leave the rest as it is and save
You should see some changes in your workspace
Publish the container changes to your website
And now it’s time to publish all your changes and make them live – to make them available on your website.
Hit the submit button on the right corner of Google Tag Manager. Create your first version and publish it.
Voila, your first version of your container is published, and it contains the tag for Google Analytics.
Before testing with the Tag Assistant, remove the previous Google Analytics tag from the <HEAD> of your page (indeed, if you follow the tutorial from the beginning you should still have the first Google Analytics code).
Now you have a basic setup of Google Analytics with Google Tag Manager. This is the minimum you should have for any website.
Go further with Google Tag Manager
This article is part of on advanced tutorial of Google Tag Manager and Analytics.
In the following articles, we will discuss advanced concepts that are often required for enterprise website configuration.
I invite you to continue configuring your site by learning how to configure environments with Google Tag Manager.