WiscWeb - WordPress UW Theme - Adding Google Analytics to a Website Using Google Tag Manager

This document will provide step-by-step instructions for adding Google Analytics to a website using Google Tag Manager.

What is it?

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.).

Be sure to use an Office 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



Keywords:GTM, GA, Google, Tag Manager, Analytics, events   Doc ID:87605
Owner:Jonathan D.Group:WiscWeb CMS
Created:2018-11-07 11:26 CSTUpdated:2018-11-13 10:10 CST
Sites:DoIT Help Desk, WiscWeb CMS
Feedback:  0   0