Setting Up Google Analytics Using Google Tag Manager

Using Google Analytics for Reporting and Quality Control

#1 in series

We have said this numerous times, Google Analytics is by far the best free source of website user statistics you could possibly hope to use.  Google Analytics will provide you data on how website visitors arrived on your website (source), important classification on who they are (audience), and what they are doing on your site (behaviours).  This is not information that can be used to individually identify a user, that's typically not even valuable information for marketing, but data you can spin and analyze to learn what digital marketing activities are actually working.  But let's not get too far ahead.  Let's begin by getting the tools in place.  The tools we strongly recommend putting in place for any website, new or existing are Google Analytics, Google Search Console, and Google Tag Manager.

Creating your Google Analytics Account

Before you can set up a free Google Analytics account, you first need a free Google account.  Simply go to, or in Canada, Click the Sign In button in the top right and then click Create a Google Account.  If you already have a Google Account, just Sign In with your account.  For new accounts there is typically a verification process, such as an email sent to the email account you provide or to the mobile phone you specify.

Once you have your Google Account, you will use the same account to set up all the tools we have listed above and described below.  It is always best that the email / Google Account used to set up the tools belongs to the business owner, or the website owner.  These are your account properties, you should own them.

Once you are logged into the Google Account you own, it's time to get your Google Analytics account.  Click the following link to get started:

You will need to name the account.  This does not need to be the name of the website.  Most often it will be your business name, but you can name the account anything you want.  Leave the Account Data Sharing Settings as they are, checked.  Click Next.  Click on Web for what you want to measure.  Click Next.  For Property details, provide the name of your website and then your website URL.  Make sure you properly indicate if your website is https:// or http://.  The industry category is only for Google's own classification so choose something as close as possible to your industry.  Setting the time zone is important as this will determine the start/end times of each day for the data being recorded.  In most cases, choose the time zone of your head office.

When you click next, Google will generate a Google Analytics account id that will look something like UA-12345678-1.  Copy this ID or keep the browser window open.  You may also see some instructions on how to install the analytics code on your website.  Ignore this for now as we recommend that you use Google Tag Manager for this which we describe below.

Setting up Google Analytics via Google Tag Manager

Once you have your Google Analytics account ID, now we need to get it so that it begins to record data from your website.  Google Analytics receives a variety of data from the data layer (produced by your website server) and can store this for future analysis.  Each time a webpage on your site loads, new data is produced.  We recommend using Google Tag Manager as the means of placing the Google Analytics code on your website. 

So first we need to get Tag Manager.  While still logged into the same Google Account as above, go to:

Follow the steps to crate a Tag Manager account and a Container Setup.  For the container name we recommend using your website domain to make it easy to identify if you should end up with multiple containers.  Click Web for the Target platform and click Create.  You will receive confirmation that a Tag Manager container has been set up and instructions on placing the Tag Manager snippet code on your website.  The Tag Manager container will have an ID such as: GTM-AB1CD2E. 

We will need to do some basic set up to tell the Tag Manager container how to send tracking data to your Google Analytics account.  Click on Workspace.  Then Click Variables.  Scroll down to User-Defined Variables and Click New.  Rename your new variable (top left) from Untitled Variable to Google Analytics ID.  Click in the Variable Configuration box, scroll down and select Constant as the Variable Type.  Enter the Google Analytics ID from above in the format UA-12345678-1 and then Click Save.  In the left hand navigation menu, click Tags, click New, rename the Tag from Untitled Tag to GA Page Views.  Click Tag Configuration then select Google Analytics Universal Analytics.  Click the box for Enable overriding settings in this tag, enter {{Google Analytics ID}} in the box.  Scroll down and click the Triggering box.  Click on All Pages.  Click Save.

Up near the top right corner, click the Submit button.  Give it a Version name such as your initials and the date and for Version description enter Initial Google Analytics set up.  Then click Publish.  You now have a Google Tag Manager container that is ready to send page view data to your Google Analytics Account.  Now we just need to have the Google Tag Manager snippet added to your website.

Add Tag Manager Snippet to Your Website

If you have a custom html website, you will need to have your webmaster or web programmer add the Tag Manager snippet code.  The details for how/where to add the snippets (there are actually 2 snippets) can be found within Tag Manager by clicking the Admin link and then the Install Google Tag Manager link.  This will provide the two code snippets.

For a WordPress site, we recommend installing a Tag Manager plug-in.  The plug-in we have found to be reliable is Google Tag Manager for WordPress.  Once the plug-in has been installed, all that is required is to provide the Google Tag Manager container ID in the format GTM-AB1CD2E.

For other Content Management Systems, such as Squarespace or Wix, we recommend you check their user documentation as they have been updated several times in recent months.  The functionality to simply  insert the Google Tag Manager container ID may already be in place.