Digital Analytics Scholarship @ CXL Institute — 10th Week Review

Mohammad Sammak
7 min readJan 25, 2021

I am very excited to start learning more about google tag manager (GTM) from a person I am professionally in love with. Chris Mercer or as he personally prefers, Mercer has been working with google tag manager for years and I know from the tag manager for beginners course that he is a real pro. Besides that, this course will prepare me more for the real deal which comes after it, and by “Real Deal”, I mean the advanced google tag manager. Let’s start and see what is there to learn.

11- Intermediate Google Tag Manager by Chris Mercer

  • This course started with a cool feature that is available in google tag manager and it is the Import/Export capabilities. You can export your entire container and a specific version of it in order to make a backup or hand it over to other users.
  • Some agencies use this feature as a monetization method and sell the exported containers as merchandise. These containers are ready to be used and are sometimes called recipes.
  • In the process of importing, you can select the workspace that you want to import the data in. it can import and replace or just merge the new data with existing ones. It is a tricky operation and needs to be done cautiously.
  • Once you know that recipes can be imported, you can use what others (mostly developers) have created. Mercer dedicated a whole lesson to tracking Vimeo and Wistia videos using the recipes that he downloaded from the internet.
  • It is actually great that you can use the things that others have created and benefit them in your measurements. I installed the Vimeo recipe and successfully implemented it. It was very easy and worked just fine.
  • When you want to measure things that google tag manager doesn’t have option by default, you can search for it on google. Chances are that you will end up finding a readily usable GTM recipe (JSON file) on the internet. But you have to be careful in choosing the website that you are downloading the recipe to.
  • It is better to only trust reputable sources like Simo Ahava, Analytics Mania, Bounteous, Thyngster (from David Vallejo), and known developers on Github.
  • Google tag manager has an almost great trigger called Element Visibility Trigger. It will fire an event whenever certain elements are visible in the browser window. For this trigger to fire, the element must be viewable and non-viewable items won’t trigger anything.
  • In order to address certain elements, you need to use either an ID or CSS Selector. If the element has an ID, you can simply use it. But in case that the needed element doesn’t have a dedicated ID, you need to use CSS Selectors. If you don’t know how to use these selectors, don’t panic. They are really simple (at least in my opinion) and if I could understand them, you could too.
  • The Element Visibility Trigger has a big flaw and I don’t recommend for you to rely on it that much. The reason behind my argument is that the elements you are targeting might not always be visible in the window as you have expected them to be. So they might screw up your measurements and you have to use them sparingly.
  • Now it is time for talking a little bit about Enhanced Ecommerce (EEC) implementation. First, I learned that EEC should not and can not be implemented using the transaction tag. It is implemented using an event or pageview tag. You can do it using your google analytics settings variable or by setting it in the GA pageview tag.
  • EEC is a little hard to implement and you might need help from your developers team. If you are running your website using WordPress (or Shopify), chances are that the needed data can be easily earned (e.g. using plugins in WordPress). But in other cases, getting help from developers is inevitable.
  • Enhanced Ecommerce will give the information on the hows (and whats) of the transactions. You will know what items are being purchased and how these items are being purchased. EEC will tell you about shopping behavior and checkout behavior.
  • When you are using GA and GTM together, there will be situations in which you need to use some custom dimensions and metrics. These custom things are necessary to measure and sort the data in tables and you will occasionally need to use them.
  • Using google analytics settings in GTM, you can send custom metrics and dimensions to GA. But you have to first define these metrics and dimensions in google analytics itself. Each metric and custom dimension in GA has a scope that might be hit, session, user, or product. Selecting each one of these scope levels will expand or limit the data.
  • And also each of them has an index number that should be exactly inserted in the tag manager. For defining the dimension and metric, you need to use the variables that are available in the tag manager itself. You can also use the guides that are available on the internet, like the one written by Simo Ahava.
  • RegEx Table and Lookup Table are great variables that are available in tag manager. They give GTM the chance to do the logical operations and make a decision. They are a kind of conditional logic that behaves like a brain and performs a logical operation. If this happens, do this. Else, do that. How great is this?
  • The only difference between the two is that the lookup table acts as an exact match and the regex table gives you the chance to target broader things. In my opinion, it is always the best choice to go with the regex table.
  • If you don’t know anything about javascript by now, it is time to rethink. Because with javascript variables, you need to know about it. We have two kinds of JS variables that do the same job in different ways.
  • If you know how to code JS or have found something on the internet, you can simply use the custom javascript variable which runs the code every time and returns a value.
  • But if the variable is something that your web browser already has access to, you can use the standard javascript variable. It is a bit difficult to find what you want to measure, but if you exactly know what you want and the answer is right there in the browser, go for this type.
  • And now it is time to talk a little bit about event variables. In google tag manager, we have two types of event variables: Custom Event Variable and Auto Event Variable. Mercer said that for custom events, we don’t have any particular application. But I remember the times at which we push things to the dataLayer and almost at the same time, tell the tag manager to fire a new event with a specific name. In those cases, we can use this custom event variable.
  • But when can we use the auto event variable? This variable consists of almost all the variables that are built-in for GTM. But I can name the element attribute or element URL that is useful and can be leveraged in some cases.
  • If you want to be a GTM master, knowing about cookies is a must. It is one of the ways that you can store the data permanently and I have to tell you that it needs some javascript knowledge.
  • Mercer used a simple cookie setting method using the way that Simo Ahava has suggested. He used a custom HTML tag to fire and in it, he used document.cookie command which sets the cookie in the most possible way. After that, he used Chrome Dev tools and went to the applications>cookies section to find the new cookie being implemented. It is very google to see that you are creating something.
  • And after that, he used a new variable called the first-party cookie which helps us to read the cookies that are available on the browser. The process of setting and reading the cookie was very easy and I have to admit that it was below my own expectations.
  • There is another way that uses a template in the gallery and using that, we can set cookies that we need. But Mercer didn’t mention it here.
  • Google tag manager has an API that lets you manage it out of the interface of the tool. Google has published it and Simo Ahava has done a tool named GTM Tools that gives us the power of it. It is definitely worth checking.
  • In the end, Mercer took the time to wrap the whole thing up and talked about some useful resources. Except for the Simo Ahava (which he referred to countless times), he also mentioned some documentation and resources that are useful for anybody who is seeking more.
  • The course has ended and I learned some new things. Now that I have experienced both beginner and intermediate courses, I can compare them with each other. I have to say that the beginner course was richer and newer than the intermediate one. Maybe that is because in the meantime, I have learned something for myself and the lessons were a little bit repeated things that I already knew.
  • I am hoping that the advanced tag manager course again shocks me and leaves me with a lot of knowledge voids. Of course, it will!
  • See you then.



Mohammad Sammak

A marketer who tries to act based on data and never stops learning.