Install Google Analytics with Google Tag Manager

Share this post

I will show you the easiest way to install Google Analytics with Google Tag Manager.

(Step-by-step)

What we are going to do is:

  1. Create a new Google Analytics tag
  2. Create a Universal Analytics tracking ID variable
  3. Add a page view trigger
  4. Preview your GA tag
  5. Publish your GTM container

Create a Universal Analytics Tag

Sign in to Google Tag Manager

Click on “New Tag”

Create a new tag with Google Tag Manager
Create a new tag with Google Tag Manager

Click on Tag Configuration > Google Analytics : Universal Analytics

Configure Google Analytics' Tag
Configure Google Analytics’ Tag

Create a Universal Analytics Tracking ID Variable

Now we will store the Google Analytics Tracking ID into a new variable so we don’t have to remember our tracking code every time we need to use it.

Click on “Select Settings Variable” > New Variable.

Select Settings Variable
Select Settings Variable

Add your Tracking ID that looks like this UA-XXXXXXXXX-1. It can be found in Google Analytics > Admin > Property > Property Settings > Tracking ID.

Configure Google Analytics Tracking ID  Variable
Configure Google Analytics Tracking ID Variable

Click Save.

Add a Page View Trigger

It is time to add a trigger to your tag. Triggering is setting the conditions where your tag will be executed.

Add a Trigger

Click on Triggering
Click on Triggering

Create a “Page View” Trigger that will fire on “All Pages”.

Click on "All pages"
Click on “All Pages”

Click Save.

Preview Your Tag

Now it is time to preview if your tag is firing properly.

Click on Preview
Click on Preview

You should have the mention “Now previewing workspace”.

Now Previewing Workspace – Default Workspace
Now Previewing Workspace – Default Workspace

Open any page in your website.

A box should have opened at the bottom of the screen.

If your Google Analytics Tag is shown under “Tags Fired on This Page”.

Your tag was properly implemented.

Preview tag firing in Google Tag Manager Preview Tool
Preview tag firing in Google Tag Manager Preview Tool

Publish Your GTM Container

You are now ready to “leave preview mode” and click “submit” to publish your container.

Publish your GTM container
Publish your GTM container

Double-Check With Google Analytics Real-Time Report

If everything is fine, you should start seeing page views in your Google Analytics Real-Time Report.

To find out, go to Google Analytics > Real-Time > Content

Google Analytics Real-Time Report
Google Analytics Real-Time Report

Congratulations, you have now installed Google Analytics using Google Tag Manager (GTM).