WiscWeb - Adding Google Analytics to a website using Google Tag Manager

This document provides instructions for adding Google Analytics to a website using Google Tag Manager.

Important

Overview

Google Tag Manager is used to track events that users trigger when visiting your website. One of the things that can be tracked via Tag Manager is your Google Analytics. You can then use the Google Analytics trigger later on for other events (such as file downloads, link clicks, etc.).

Steps

Reminder: Always use an Microsoft 365 Service Account to create your Google Analytics and Google Tag Manager accounts.

  1. In Google Tag Manager, navigate to your Workspace Tab.

    Google Tag Manager Workspace view

  2. From your Workspace Tab, navigate to Tags and click the button labeled, New.

    Tags section with the New button

  3. Name your new tag something appropriate, like "GA Page Views", set the Tag Type to “Google Analytics - Universal Analytics," and the Track Type to "Page View."

  4. In the Google Analytics Settings drop down, click that and select "New Variable." Give this variable an appropriate name, like "GA Analytics Code" and enter your Google Analytics Tracking ID value into the Tracking ID field.
    • You can find your UA Tracking ID under “Property Settings” in the Admin section of your Google Analytics account.

  5. Click into the Triggering section, and select "All Pages." This will tell this tag to trigger on every page within your site.

  6. Click Save in the upper right section of your tag.

    Completed Tag for Google Analytics

  7. With your Tag and Variable created and saved, you are returned to your Workspace. From here you need to publish your changes by clicking on the Submit button in the upper right section of the window. You will be prompted twice to enter information about these changes - this is good for keeping track of the updates that you make in case you don't remember.

    Tag Manager Workspace submit button

  8. Once you’ve published your Google Tag Manager container, you can add it to your WordPress customizer area by taking the Tag Manager Tracking ID (usually GTM-XXXXXXX) and putting it into your Customizer area (Appearance --> Customize --> Analytics). You can remove your Google Analytics Tracking ID, and then Publish your changes to commit them to your site.

    Place Tag Manager Tracking ID into WordPress site


KeywordsGTM, GA, Google, Tag Manager, Analytics, events, data, metrics, connect, add, customizer, trigger, tags   Doc ID87605
OwnerJenna K.GroupWiscWeb
Created2018-11-07 11:26 CSTUpdated2023-08-01 08:51 CST
SitesDoIT Help Desk, WiscWeb
Feedback  0   0