Google Tag Manager Setup & Event Tracking Guide

Google Tag Manager Vocabulary

  • Account:  an account usually represents an organization, agency, institution

  • Container:  containers represent individual or multiple domains for which all the events should track to the same 3rd party tracking services

  • Tag:  tags represent KPIs for interactions with the website- they may be individual events or groups of events.  For example, tracking all items being added to a shopping cart of an e-commerce site.

  • Trigger:  triggers represent the different scenarios for which the tag should record data.  For example, the "add to shopping cart tag" could include "clicking add to cart button" and "clicking increase quantity button" or even a "buy now callout".


Part I:  How to Add Code to Websites

  1. Sign-In to Google Tag Manager.

  2. Under your account, navigate to the container for the site you would like to add code.  (i.e. mysite.org, anothersite.com, yetanothersite.com, example.net. )

  1. In the workspace tab, click the container’s ID Number. (GTM-XXXXXXX)

              OR

    In the admin tab, click Install Google Tag Manager

  1. Follow the instructions to copy and paste the code into the head and body of your site. [This is a one time setup in the site’s HTML that a website administrator will need to apply to the code.  NOTE- any existing tracking snippets/services should remain in place on existing sites until everything has been ported over to and verified with GTM]

 


 

Part II: Adding Tags/Triggers with Google Analytics or another service (i.e. Google AdWords, DoubleClick, BingAds, etc.)

For the purpose of this tutorial (reflected in the screencast linked further below), we will add a tag and trigger to track when a user clicks on the “Find a Doctor” button on www.foxchase.org.  Notes for applying similar event triggers are identified in [square brackets].

  1. Navigate to Triggers on the left-hand navigation and create a new trigger with the following settings:

  • Type: Click

  • Targets: Just Links

  • Wait for tags: Check

  • Max wait time: (use the default value of 2000ms)

  • Check Validation: Uncheck

  • Enable When: Click URL contains find-doctor [the find-doctor here is a segment of the url, depending on your use case, you may have other urls or a wildcard scenario]

  • Fire On: All Link Clicks

  • Save Trigger as “Find A Doctor Clicks” [this name/short description should be meaningful to your marketing team]

 

  1. Add a new Google Analytics event tracking tag and set the firing conditions to the corresponding triggers configured above:

  • Tag Type: Universal Analytics OR another service (i.e. Google AdWords, DoubleClick, BingAds, etc.)

  • Tracking ID: Enter Google Analytics Tracking ID or ID from other service that is built into site. (For Universal Analytics: “UA - XXXXXX - X” or, if a constant variable with GA Tracking Code has been set up, click the variable icon to the right of the text box and choose GA Tracking Code. This will populate the text-box with {{GA Tracking Code}}.)

  • For Universal Analytics:

    • Track Type: Event 

    • Category: Menu Item [Google Analytics will store each event with a category which can be plain text- you can later filter your data in a spreadsheet by sorting on the label column or filtering specific text]

    • Action: Select

    • Label: Find a Doctor  [Google Analytics will store each event with a text label- you can later filter your data in a spreadsheet by sorting on the label column or filtering specific text]

    • Tag Name: UA - Event - Find a Doctor [The tag name is specific to GTM, and should be friendly enough for your marketing team to readily identify what it is for]

 

  1. Click Triggering below

  2. Select Find a Doctor Clicks trigger.

  3. Click Save in top-right of screen.

 


 

Part III: Testing:

  1. Click the dropdown arrow to the right of the Publish button in the top-right of the workspace tab.

  2. Select Preview and Debug

  3. Navigate to a new tab and go to www.foxchase.org [or your impacted site/sites where you expect the event to fire]

  4. Test out the event that was just created.

 


 

Part IV: Demo

This is a screen recording of steps documents in Parts II & III above (setting up a Tag/Trigger for an event that will only occur on www.foxchase.org mobile and then testing that Tag/Trigger).

https://www.youtube.com/watch?v=PAMcO2--hCQ&feature=youtu.be

 


Example 2:  Setting up a Google's Universal Analytics Event Tracking Tag for Clicking on a Callout

​The screenshots in this example reflect the steps to setup an event tracking tag for users clicking a Video Callout on the www.meetsellersdorsey.com site.

  1. In the first screenshot (the workspace tab/dashboard): 
    1. note the active/selected container indicated in the top left of the screen (if you have multiple containers, be sure to be editing/modifying  the proper one)
    2. Click the Add a New Tag link
  2. In the second screenshot (the new tag setup form):
    1. Give the tag a name at the top of the screen.
    2. Then click on the tag configuration pane
  3. In the third screenshot (the available tag integrations and custom options):
    1. Select Universal Analytics
  4. In the fourth and fifth screenshots (the UA tag event setup screen):
    1. Set the various values
    2. In the Action section, you can click on the ADD VARIABLE button to right to select a predefined/global value
    3. Set the non-interaction hit state to FALSE
    4. Click the Triggering pane
  5. In the sixth screenshot (the Triggers/Triggering configuration):
    1. Click add at the top right to add a new trigger (condition)
  6. In the seventh screenshot (the new Trigger setup form, similar to new tag setup form):
    1. Give the trigger a name at the top of the screen.
    2. Then click on the trigger configuration pane
  7. In the eighth screenshot (the available trigger types and custom options):
    1. Select All Elements (to target HTML elements other than simply anchor tags)
  8. In the ninth screenshot (the trigger configuration pane):
    1. Fine tune the trigger to only fire for "some clicks"
    2. Identify the conditions that define the elements being clicked that should be tracked (in this case, the class on the element) [Note classes can be extremely generic- be sure the html element class you specify does not apply to anything else on the page].
    3. Click the save button at top right to save the configuration for the one trigger
  9. In the tenth screenshot (the Triggers/Triggering configuration):
    1. Click the save button at top right to save the configuration for the one trigger
  10.  In the eleventh screenshot (the workspace dashboard, tags tab):
    1. Click the dropdown next to publish button at top right
    2. Select PREVIEW button to begin previewing and debugging
  11. In the twelfth screenshot (a new browser tab of the site/webpage where you expect the event to happen):
    1. Note the debugger "not fired" status (underlined in red on the screenshot) 
    2. Test your use case by clicking on the element on the page.  
  12. In the thirteenth screenshot (the browser tab of the site/webpage, after you've clicked the element to trigger the event):
    1. Note the debugger status has changed from "not fired" to "fired" (underlined in red on the screenshot) 
  13. Having confirmed the event trigger works, your tag is now ready for publishing.  Do not publish the tag until you're ready to begin tracking the event- typically a day or two before an actual campaign launches.  Note the date of publishing so you can filter it out in your reports.

 

Screenshots for Tag/Trigger setup for www.meetsellersdorsey.com:

​http://general-guide.howtodrupal.easternstandard.com/sites/general-guide.howtodrupal.easternstandard.com/files/meetsellersdorsey%20gtm%20guide%20%281%29.pdf

 

Useful Resources:

Tag Manager Help:

https://support.google.com/tagmanager/answer/6106716?hl=en

Variable Guide for Google Tag Manager:

https://www.simoahava.com/analytics/variable-guide-google-tag-manager/#intro

How to install Facebook Pixel with Google Tag Manager:

https://www.facebook.com/business/help/1021909254506499

 

Recently Updated in Additional Site Management Features