Mason GTM Container

Mason Standard GTM Container

The Mason standard GTM container tracks page views, embedded YouTube video activity, and clicks on outbound, email, and file links, as well as user interaction with expandable content areas.

This container supports the following:

Google Analytics- Universal Analytics

  • One Google Analytics property for the local website
  • Two Google Analytics roll-up properties

Google Analytics 4

  • One Google Analytics 4 property for the local website
  • Two Google Analytics 4 roll-up properties

Download the Mason GTM Template Container (version 3.4.1)

Version History

2022-07-20 – Version 3.4.1 released – Adds GA4 measurement ID numbers to browser console debug output and makes other minor technical/organizational updates.

2021-08-20 – Version 3.4 released – Adds Google Analytics configurations for the local website and up to two roll-up properties. Also, trigger parameters for the expandable content event tag was updated (applicable for SiteMasonry sites).

2018-02-26 – Version 3.3 released – Adds a “window loaded” trigger. The auto-link domains list is now shared across both roll-up properties. The “IsLocalWebsite” variable has been made less restrictive in order to accommodate multiple domains or subdomains.

2017-12-12 – Version 3.2 released – Adds tracking of user interaction with expandable content areas. Improves organization by adding folders for standard implementation settings, content unique to the implementing website, and content added by third-party vendors.

2017-09-12 – Version 3.1 released – Adds output of debugging info to JavaScript console.

2017-09-06 – Version 3.0 released – Adds tracking of embedded YouTube video activity.

2017-07-12 – Version 2.0 released – Includes tracking of page views and clicks on email, download, and outbound links.

Previous Versions

Download the Mason GTM Template Container import file (version 3.3 – 2018-02-26) – Includes “window loaded” trigger. The auto-link domains list is now shared across both roll-up properties. The “IsLocalWebsite” variable has been made less restrictive in order to accommodate multiple domains or subdomains.).

Download the Mason GTM Template Container import file (version 3.2 – 2017-12-12) – Does not include “Window Loaded” trigger. Auto-Link Domains list only applies to rollup01. The “IsLocalWebsite” variable is more restrictive: container can only be used on a single domain (optionally with a www).

Download the Mason GTM Template Container import file (version 3.1 – 2017-09-12) – Does not include expandable content area interaction tracking.

Download the Mason GTM Template Container import file (version 3.0 – 2017-09-07) – Does not include debug info output.

Download the Mason GTM Template Container import file (version 2.0 – 2017-07-12) – Does not include embedded YouTube video tracking.

Configuration

When deploying this container template into GTM containers used on other websites, you will need to customize the following items. All of these items can be found in the folder called “00 standard configuration settings”.

TypeNameDescriptionNotes
VariableHostname - localStores the host name (domain name) of the website on which the GTM container is implemented. Set this to the domain name of your website.Analytics will not fire unless the domain name of the website matched the domain name specified in this variable. This help to prevent GTM code from activating if inadvertently included on other websites, or when operating in a pre-production or testing environment.
VariableUAID - localStores the Google Analytics property ID number for the GA property used by the website.
VariableUAID - rollup01Stores the Google Analytics property ID number for first GA roll-up property used by the website (typically the Mason university roll-up).This is pre-set to use the Mason university roll-up, and typically does not need to be changed.
VariableUAID - rollup02Stores the Google Analytics property ID number for second GA roll-up property used by the website, if applicable.This is up to the website owner in question, and is typically used for a unit- or department-level roll-up property.
TagGA4 - localStores the Google Analytics 4 measurement ID number for the GA4 property used by the website.
TagGA4 - rollup01Stores the Google Analytics 4 measurement ID number for first GA4 roll-up property used by the website (typically the Mason university roll-up).This is pre-set to use the Mason university roll-up, and typically does not need to be changed.
TagGA4 - rollup02Stores the Google Analytics 4 measurement ID number for second GA roll-up property used by the website, if applicable.This is up to the website owner in question, and is typically used for a unit- or department-level roll-up property.
Triggerclick - expandable areaThis trigger is responsible for sending the tracking information relating to clicks on expandable content areas. The trigger firing conditions must be set to indicate the CSS selector which identifies the elements used to expand expandable content areas.This is pre-set to work for Mason standard Drupal websites. If your website is on a different platform, and uses expandable content areas, set this to a CSS selector which will identify the elements used to expand expandable content areas.

For example, in Mason's Drupal websites, the element triggering the expandable area can be identified with the css selector: div.expandable-content-wrapper div.expandable-content div.header a.
In WordPress websites using the Collapse-o-Matic plugin to handle expandable areas, the element triggering the expandable are can be identified by the CSS selector: .collapseomatic.

If you need to track across domains, you may need to modify the following variable (found in the “settings” folder):

  • Auto Link Domains
    • stores the domain names included in cross-domain tracking

Event Tracking

Outbound Links

Clicks on outbound links will send a GA event with the following data:

Category: outbound link
Action: {{Click URL}}
Label: {{Click Text}}

Email Links

Clicks on email links will send a GA event with the following data:

Category: email
Action: {{Click URL}}
Label: {{Click Text}}

File Links

Clicks on links for certain types of files (pdf, xls, xlsx, doc, docx, txt, csv, json) will send a GA event with the following data:

Category: download
Action: {{Click URL}}
Label: {{Click Text}}

YouTube Videos

User interaction with embedded YouTube videos to include the following data:

Category: video
Action(s): play, pause, 25%, 50%, 75%, 95%, complete
Label: [Video name]

Expandable Content Areas

User interaction (opening or closing) of expandable content areas to include the following data:

Category: expandable content
Action(s): open, close, indeterminate
Label: [Actual text of element which is clicked to trigger the expandable content area]

Additional Steps to Avoid Tracking Logged-In Users

Drupal

For Drupal websites using the Drupal GTM module, you will need to configure the GTM Drupal module on your website to prevent tracking of logged-in users. More information about implmenting GTM in Drupal.

WordPress

This container will interface with DuracellTomi’s GTM WordPress plugin. If your WordPress site has this plugin installed (and configured to provide login state information, see below) this container will not send any tracking data for logged-in users.

To avoid tracking logged-in users for your WordPress website, please configure the plugin as shown below: