Categories
Procedures

Add Google Analytics tracking to Google Tag Manager

A step-by-step procedure on how to add Google Analytics tracking to a Google Tag Manager container.

Requirements

This procedure will work only if:

  • The Google Analytics property exists.
  • The Google Tag Manager container exists.
  • You have admin access to both.

Procedure

1.

Login to Google Analytics and navigate to the account in question.

2.

Click Admin at the bottom of the left navigation menu, select the property in question in the Property column, then click Tracking Info and Tracking Code.

Location of the Tracking Code navigation option.
3.

Highlight the Tracking ID and copy it to your clipboard (Ctrl+C).

Location of the Tracking ID.
4.

Open a new browser tab (Ctrl+T), login to Google Tag Manager with your Google account and navigate to the container in question.

5.

In Workspace click Tags, then New.

Location of the New Tag button.
6.

Click inside the Untitled Tag field and rename the tag to GA - Pageview - All Pages.

Location of the Tag title field.
7.

Click inside the Tag Configuration box and Choose tag type Google Analytics: Universal Analytics.

Location of the tag type Google Analytics: Universal Analytics.
8.

Click the + icon next to the Tracking ID field. On the next screen, click the + icon in the top-right corner.

Location of the + icon next to Tracking ID.
Location of the + icon in the top-right corner.
9.

Click inside the Untitled Variable field and rename it to GA Tracking ID.

Location of the Variable title field.
10.

Click inside the Variable Configuration box and Choose variable type Constant.

Location of the Constant variable type.
11.

Paste the Tracking ID from your clipboard into the Value field (Ctrl+V) and click Save.

Location of the Tracking ID value field.
12.

Check the Tag Configuration contains the {{GA Tracking ID}} variable inside the Tracking ID field.

Location of the {{GA Tracking ID}} variable.
13.

Click inside the Triggering box, the Choose a trigger All Pages.

Location of the All Pages trigger.
14.

Check that both variable and trigger are properly filled out, then click Save.

Save Tag.
15.

Click Preview.

Location of the Preview button.
16.

Open a new browser tab (Ctrl+T) and load the website’s home page (refresh the window, if already loaded).

The Google Analytics tracking code is working properly, if you see the name of the tag among the Tags Fired On This Page in the debug pane.

Location of the tag inside the Debug pane.

Note: Currently, the Debug pane doesn’t display on AMP websites. Please skip this step in case the website in question is using AMP.

17.

Switch to the browser tab with Google Tag Manager. Click Leave Preview Mode. Click OK to confirm leaving the preview mode.

Location of the Leave Preview Mode link.
18.

Click Submit. Click Publish. Click Continue.

References

Revision history

1.1.0

2020/03/08 – Changed process for creating the custom variable. Refreshed screenshots to accommodate user interface changes.

1.0.0

2018/01/08 – First version released.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.