Intermediate Google Tag Manager

Arsene Zounon
5 min readJun 13, 2021

JavaScript is an essential skill for any Digital analyst.

Photo by Tamara Gak on Unsplash

Before taking this course, make sure that you understand GTM and are comfortable with the basics of GTM for Beginners course.

Use intermediate-level GTM knowledge for greater data governance and control over tag management.

This training program will give you

  • Greater data governance and control over your tag management.
  • Knowledge of underutilized and super powerful GTM features.
  • A thorough QA process and ways to speed up your changes and implementations across teams.

Course summary

1. Intermediate GTM Intro

2. Tracking Engagement: Advanced Video Tracking

3. Tracking Engagement: Page Elements

4. Tracking Ecommerce: The Next Level

5. Deep Dive: Custom Dimensions & Metrics

6. Deep Dive: User ID Tracking

7. Deep Dive: Table Variables

8. Deep Dive: JavaScript Variables

9. Deep Dive: Event Variables

10. Deep Dive: Using Cookies in GTM

11. Deep Dive: GTM API

You should know what Tags, Triggers and Variables are. Built-in and user-defined variables, GA setting variable… If you are not comfortable with the basics, it’s better to stop this course and go back to take GTM for beginners’ course at CXL institute. This will help you learn and have experience with GTM. Only then you will benefit this course.

Importing and exporting container. Those are tools to make backup or transfer containers. The exported file is a JSON file format.

Admin > Container > Export Container

Admin > Container > Import Container

By using this feature, you can import GTM Recipes (built by GTM experts) into your account. Make sure you double check import settings as you can override your container and lose your own settings. Anytime you want import, it’s important your carefully read documentation of the file you want to import and make sure it really solves your needs. You can modify the recipes to make it match with your naming convention, and Category — Action — Label. You have also to preview the workspace before publish.

TRACKING ENGAGEMENT: ADVANCED VIDEO TRACKIN

In GTM you can track YouTube embed videos with the preinstalled built-in features. You already know how to do it. But for third party video platforms it’s another story. Searching on Google, you will find recipes for majors’ platforms (Vimeo, Wistia…) that you can import and merge in your container. These recipes used Custom HTML add JavaScript script to collect needed data.

TRACKING ENGAGEMENT: PAGE ELEMENTS

Scroll is great but sometimes it’s just not enough. If you want to track various area of your pages showing on the browser, form Submission… there are other tools that can help.

You can use Element Visibility Trigger. Like Simo Ahava said, this “fires whenever an element, or elements, you specify appear in the browser’s viewport. The viewport is the visible area of the browser window, meaning if an element is visible there, it is viewable by the user.”

Tag Manager has a built-in Trigger for this

To setup this you go to: Triggers > User Engagement > Element Visibility

TRACKING ECOMMERCE: THE NEXT LEVEL

When Standard Ecommerce works and when it doesn’t. to catch the difference between them, think about the story that the ecommerce report can tell. Standard Ecommerce gives data about WHAT was purchase while the Enhance Ecommerce gives data about WHAT was purchase but especially HOW that happen. You can track different steps with Enhanced Ecommerce but you are not obliged to track them all:

· Product Impressions

· Product Clicks

· Product Detail Impressions

· Add / Remove from Cart

· Promotion Impressions

· Promotion Clicks

· Checkout

· Purchases

· Refunds

This use the Data Layer and as this is a bit technical, it’s a good idea to work with your developer to implement it.

DEEP DIVE: CUSTOM DIMENSIONS & METRICS

Sometimes you have to answer very specific questions using information that GA doesn’t provide by default. You have to customize GA to get that information. Go to Google Analytics Admin > Property > Custom Definitions > Custom Dimensions or Custom Metrics.

If you are asking yourself which one to choose, just remember that Custom Dimensions are things you sort by in GA and Custom Metrics are the numbers.

DEEP DIVE: USER ID TRACKING

GA offer cross-device tracking report but sometimes this don’t match with what you need. User ID tracking come in help in that case but pay attention to Personal Identifiable Information (PII) as this can cause Google to delete your data. Hopefully when you are enabling User-ID tracking inside GA, your will have to review the policies and make sure you are not collecting personal information (email, name, address…) of any of your users.

DEEP DIVE: TABLE VARIABLES

By using Table Variables, GTM can make some decisions for you based on various logic. You have two type of Tables Variables: Lookup Table and RegEx Table. You want to use one of them to return back a value you defined based on certain value of a variable.

To set them up, go to User-Defined Variables > Utilities

DEEP DIVE: JAVASCRIPT VARIABLES

Two of the different types of JavaScript variable available in GTM:

· JavaScript Variable: it’s like the Data Layer but instead of going inside the Data Layer, the information goes inside the browser. Gives you access to what the browser has access to. We can collect the information on the window object and send it directly to GA.

· Custom JavaScript Variable: can be used to do a lot of things. You can find a lot of scripts searching on Google and used them on your own GTM. As usual test, preview before saving as this can break your website.

To set them up, go to User-Defined Variables > Page Variables

DEEP DIVE: EVENT VARIABLES

Custom Event Variable is not really useful as it gives you information that are already collected by GTM default settings.

Auto-Event Variable many of the settings are already built-in and collected by GTM but Element Attribute, one of those settings is a specific one that can come pretty handy.

To set them up, go to User-Defined Variables > Page Elements > Auto-Event Variable

To set them up, go to User-Defined Variables > Utilities > Custom Event

DEEP DIVE: USING COOKIES IN GTM

GTM can be used to set or read cookies.

To set Cookies, you will use Tag > Custom HTML Tag and type or paste your JavaScript there. You can use any already set Trigger and Variable.

To read cookies you will use First party cookies and do whatever you want with this collected data.

DEEP DIVE: GTM API

This API is a backdoor for GTM. Simo Ahava have a large library of tools you will use with your own GTM account.

CONCLUSION

This is a very good course for anyone that have the basic knowledge and experience with GTM. There is a lot of ways to do things in GA and you will learn some of them. After this, you can take the CXL Institute GTM advanced course by Simo Ahava.

--

--