Google Tag Manager for beginners — Understanding Google Tag Manager Part 3

Deepak Garg
5 min readJan 10, 2022

I started with Google Tag Manager for Beginners course on CXL, and my tutor is Chris Mercer from measurementmarketing.io.

This is the final part of the training and during the week, we covered some advanced topics that includes Cross-Domain Tracking, Tag Sequencing and Formatting Variables.

#Cross Domain Tracking:

From time to time, a user journey crosses different domains.That’s called cross-domain tracking. Now in order to setup the Cross-Domain Tracking, the first step is to add the another domain into the referral exclusion list of Google Analytics .

Now in order to set up the Cross-Domain Tracking through Google Tag Manager, Go to the Variables in Google Tag Manager, then select the Google Analytics variable we created to track the GA through GTM. then in the variable settings we have cookie domain selected as Auto that means all the Subdomains will be tracked automatically but not the root domains so in order to start the cross domain tracking, we will select the more settings and the field settings we will be adding both the root domains and save it. This again is just for cross domain, we need to allow the linker, there’s actually going to be a linker, and when we preview the GTM on the live site, we will see a linker event firing that means our cross domain is working perfectly.

Now you know it is when in a single session,in the same visit, the user is going literally across domains, across root domains.You need to make sure that the client ID stays in tact and that’s how you know if you need to fix your setup because if you cross different domains in the same sessions and you’re supposed to remain the same user,that client ID should be the same.And of course, now you know how to see that with the GA Debugger extension.We talked about seeing that Client ID.Then of course we talked about how to implement that fix with the Google Tag Manager.We also talked about of course updating your Google Analytics set ups with exclusions,as just a little cherry on top so that you know how to complete the entire process and that will help make sure that your traffic attribution remains in tact, whatever caused that session,for example, if you sent Facebook traffic to that same session that you and I just went through,Facebook would actually get credit for the sale because the client ID stayed the same the entire time.It’s really really important that you cover this.

Resources to Checkout:

Google’s Guide to Cross-Domain Tracking: https://support.google.com/tagmanager/answer/6164469

Simo Ahava’s Guides to Cross-Domain Tracking: https://www.simoahava.com/tags/cross-domain-tracking/

#Tag Sequencing:

In Google Tag Manager, timing is important,and, fortunately, there are ways that you can actually control what order tags fire in so this lesson covers how to set the sequencing of different tags. Google Tag Manager works in asynchronous mode that means everything sort of fires at the same time when it’s being told to fire.

You need it because there are going to be times in your tag manager career that you will need to have more of a defined control over the order of when tags fire.Tag sequencing will help you to do that.And of course, we talked about setting up tag sequences in Google Tag Manager.It’s actually pretty simple.All you have to do is go into the tag that you’re going to use, that everything is going to be built around, and you would define the setup and/or the cleanup tags.So again, the setup tag is the tag that will fire before the tag that you’re in,and the cleanup tag is the tag that will fire after the tag that you are currently in that particular case.

Lesson Resources:

https://support.google.com/tagmanager/answer/6238868

Simo Ahava’s Guides to Cross-Domain Tracking: https://www.simoahava.com/tags/cross-domain-tracking/

#Formatting Variables:

During this lesson, we covered changing things to lowercase to keep it nice and consistent, updating and making it more definable,user-friendly values instead of undefined.

During the lesson, we discussed formatting user-defined variables. In order to do that, just navigate to the variable, under the variable more settings, we can select different options like convertNull to , ConvertUndefined to and Convert True to or maybe change CaseID. We can select any custom data layer variable or javascript variable.

Incidentally, pro tip for Google Analytics,anything that’s undefined is a hit is technically dropped in Google Analytics. Analytics won’t send it through if it sees that it’s undefined, so if you really,sometimes that’s useful and you want an undefined hitto not go through and not be passed through.Sometimes you want it to be like, hey, nothing’s here.Again, not every variable will need to have its value formatted,but know that you can do it.

Lesson Resources:

Simo Ahava’s Guide to the Format Value Option in GTM: https://www.simoahava.com/analytics/format-value-option-in-google-tag-manager-variables/

Course Recap

During the Course, we discussed all about the tags and how to setup different tags in Google Tag Manager, How to configure different types of variables, different ways to organize the folder, how to read the data from data layer information, how to pass information to the Google analytics, How the scroll depth pre built in variable works in Google tag manager and how to pass that information to Google analytics. We also covered setting Up Google Analytics, Facebook Pixels and Custom HTML tags through Google Tag Manager. How to publish different changes, How to set up the Youtube tags and triggers for different events. We also covered ecommerce tracking through Google Tag manager and how to push ecommerce information through GTM and store that information into Google Analytics.

As a Bounce Lesson, we talked about Form Submission Triggers in Google Tag Manager. We also discussed different features that the Form Submission Trigger of GTM has.

The course really helped me in understanding the basics of Google Tag Manager and I really liked the part of creating data layer codes that I was completely unaware of. The course also helped me to uncover different triggers that I have never used and find out those are really awesome triggers that help with the data analysis.

--

--