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.


This procedure will work only if:

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



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


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.

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

Location of the Tracking ID.

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


In Workspace click Tags, then New.

Location of the New Tag button.

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

Location of the Tag title field.

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

Location of the tag type Google Analytics: Universal Analytics.

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.

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

Location of the Variable title field.

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

Location of the Constant variable type.

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

Location of the Tracking ID value field.

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

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

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

Location of the All Pages trigger.

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

Save Tag.

Click Preview.

Location of the Preview button.

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.


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.

Click Submit. Click Publish. Click Continue.


Revision history


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


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.