In this article about Google Tag Manager I will give you an overview about the important settings about tags, triggers and variables. Also how to organize best your GTM structure to keep a good overview. For more details you can have a look in the reffered links, mostly from google support and also from CXL blog articles and playbook.
Table of Contents
Your Introduction to Google Tag Manager Basics
- For A/B testing ist not reccommended to use GTM since the script for a/b testing pageviews should be loaded on first place and not the GTM tracking code
Getting to Know GTM: Tags + Triggers
- Tag is used for “what” kind of platform e.g. facebook, GA, LinkedIn …
- Trigger is used for “when” it should trigger/record the tag e.g. pageview, scroll-down-to-50%,click specific link and so on
Getting to Know GTM: Variables
- Variables can have different values e.g. play video, widgets, cookies, google analytics settings, URL…
- “Information google tag manager needs in order to do his job”
Variables in Google Tag Manager are named placeholders for values that are populated when code is run on your website or mobile app. For example, the Tag Manager variable named “Page URL” returns the current web page URL.
Variables are used in both triggers and in tags:
- In tags, variables are used to capture dynamic values (e.g.: pass a transaction value and product ID to a conversion tracking tag).
- In triggers, a variable is used to define filters that specify when a particular tag should fire. (e.g.: fire a trigger when the url variable contains “example.com/index.html”).
Tag Manager provides a set of predefined built-in variables. Built-in variables handle most needs for tag and trigger configurations. You can also create user-defined variables for web pages or mobile apps to suit specific requirements that might not be covered by built-in variables.
Google’s Guide to GTM Variables
Getting to Know GTM: Data Layer
Temporarily stored details like:
- Product data: Product name, price, category
- Marketing campaign information: Traffic source, medium
- Transaction data: Cart value, checkout date
- Customer information: New or returning customer
- each individual page has its own data layerbecause each individual page in this example is loadingTag Manager again and again and again
Google’s Guide to GTM Data Layer
Getting to Know GTM: Organization
- Naming declaration for tags, trigger, variables is very important for good organization and structure!
- A good folder structre helps you for that organization
One account, multiple containers
Most organizations will set up a single Tag Manager account for all of their containers. Within that account, the most common practice is to use a unique container for each website or mobile app. For example, a bike shop has a website that is set up to showcase their business, and they have built an app to track workouts. They have set up four containers in Tag Manager:
- Container 1: Web container for a bike shop website.
- Container 2: Web container for a web app that tracks bike workouts.
- Container 3: Android container for a mobile app that tracks bike workouts.
- Container 4: iOS container for a mobile app that tracks bike workouts.
Google’s Guide to GTM Organization
Regular Expressions for Google Analytics
Getting to Know GTM: Workflow
- Set up own workspaces for individual folder structure or specific variables
- Makes sense to use typically when you are more then 2 users who save changes
- If you use GTM alone probably the default workspace is enough
Google’s Guide to Publishing, Versions, & Approvals
Google’s Guide to Environments
Google’s Guide to Zones
Getting Started: Creating Your First Tag
- Be sure to have only 1 pageview send from GTM to GA
Google’s Guide to Deploying Google Analytics
Google’s Guide to Google Analytics Settings Variable
Tracking Engagement: Clicks & Time
GTM – tags:
GTM – triggers:
e.g. clicks, pageview, links, timer
GTM – preview mode:
Google’s Guide to Click Triggers
Google’s Guide to the Timer Trigger
Tracking Engagement: Scroll
Scrolling is a non-interactive engagement which means it should not affect the bounce rate.
-> For that reason it´s better to set up “non-interaction hit > true”
Google’s Guide to the Scroll Depth Trigger
Tracking Engagement: YouTube Videos
Set up YouTube Video Tag, Trigger, Variables:
Enable this trigger on: Choose the appropriate option:
- Loading of the container (gtm.js) is triggered as soon as possible when the page is loaded.
- Loading window (gtm.load) fires after all initial content on the page has loaded (default).
- DOM is ready (gtm.dom) fires after the DOM is ready to be parsed.
Note: Because the scroll depth trigger calculates the dimensions of a page as it loads, it’s a good idea to wait until the window is fully loaded before activating this trigger. Therefore, “window is loaded (gtm.load)” is recommended for best results.
YouTube video triggers work for videos that load both during and after page load. This requires at least one of the following to be present when Tag Manager loads:
- An embedded YouTube video
- The YouTube iFrame API script in <script>
Google’s Guide to the YouTube Video Trigger
Personal feedback about the Google Tag Manager course:
Same like the other courses from Chris Mercer (Google Analytics for Beginners/Intermediate) I enjoyed how he teaches his courses and also from high level persperctives via lucidchart diagrams. It´s easy to follow him and his approach ‘TBV’ – test by verify gives the proof to all the assumptions he is telling.1