Digital Analytics Scholarship @ CXL Institute — 11th Week Review

Mohammad Sammak
11 min readFeb 1, 2021

And the waiting is over! I have finally landed on the course I always wanted to participate in and now is the time. Simo Ahava is here with the Advanced Google Tag Manager course. Aren’t you as excited as I am? Let’s dive into the black hole and find out where it takes us with it.

12- Advanced Google Tag Manager by Simo Ahava

  • Simo starts this course as is expected from a pro like him. He starts by talking about the curriculum of this course and the topics that are covered in it. Right from the beginning, it is apparent that I am going to encounter a bunch of technical stuff and things that I don’t know about.
  • Simo is talking about the process that happens behind the curtain and things that will lead to actions that Tag Manager does. He says we need to know about the GTM API and the power it gives us.
  • First, he is going to talk about event tracking. I don’t know what is waiting for me there, but I am excited to hell! Let’s dive in.
  • The first lesson was about event tracking in GTM and I have to say that it started as a storm! Simo immediately started talking about all of those event listeners and how pushing to the data layer works. He opened a dev tools window in google chrome and showed us what happens when we push to the data layer.
  • The data layer isn’t storage for all of our changes and if we push multiple similar items to the data layer, it only keeps the most recent one. It actually overwrites the old data with the newer one. And we have to know that GTM only listens to push commands, not pop. we can’t take something out of the data layer.
  • Then Simo showed us different triggers and the events that they push to the data layer. He also showed a complicated model which was about the DOM and what GTM does when we target the elements on the page. He talked about a concept named event propagation which seemed a clever term and was actually something like that.
  • I think I understood this notion and if I want to describe it, I might stumble multiple times. But let’s put it this way: we want to address a child item that has multiple levels of parents. When we address that child, GTM first finds its parent and step by step, goes down to find it. On its way back to report on the findings, it has to go back all the way that it has come and this is called bubbling. Sometimes, extra JS codes might block it and hence, stop GTM from functioning properly. I tried to teach you whatever I had learned.
  • Now I have completed the custom event listeners section and I have to tell you that I’m literally “blown away”. Simo is a grandmaster and learning about custom event listeners from him took a lot of my energy! It was a real brain exercise and now I feel like am fu**ing Einstein!
  • Although the event listeners in GTM are quite good and comprehensive, they are not that comprehensive and we’ll end up having the need for a lot of custom listeners and need to create them. Simo says there are no ways to do this except doing it the old fashioned way: coding!
  • Now I know about browser events and click events and know how to use them for creating custom event listeners. The example that Simo used to teach us about this topic was so thorough that nothing is left untold.
  • I practiced it both in the browser console and in GTM. It was a little time-consuming, but I think it was worth it. He even taught us how to add custom error messages and add conditions for certain events.
  • It was a good lesson and I am wondering what lies ahead. Believe me: this review is gonna be a big one and it is inevitable. I am enjoying this course from Mr. Ahava and I want to make it eternal here!
  • Believe me when I am telling you that I like Simo Ahava and worship him in a way. But he is getting really scary! He assumes that we are technical people and have a background in coding. But it is most certainly not true, at least in my case!
  • The thing about his course is that you can’t just watch the lessons sequentially and make it to the end (not that I have done this for the rest of the courses, I’m telling you the truth). For every lesson, I need to first watch it from beginning to the end and then rewatch it to only start understanding what was going on in it! Either my knowledge is minimal, or he is teaching whatever he knows mercilessly.
  • In using google analytics, we use a thing called a Tracker Object which is a google analytics library (or at least this is a thing that I can remember from the lesson). When we are using universal analytics or global analytics, we are directly using this tracker object. In the cases in which we are implementing google analytics using GTM, the tag manager will use this object to send hits to google analytics.
  • But the thing is that google analytics creates this Tracker Object with every page being loaded and in each time, considers a set of items that might not be 100 percent true. Simo Ahava showed us an example regarding a SPA (Single Page App) website that when you are browsing, only URLs change and the page doesn’t reload. This might lead to some miscalculations in google analytics data.
  • Simo showed us that when traffic is coming from google ads, it has the gclid query parameter which tells GA about its traffic type (CPC). but in SPA, when the user goes to another page after landing on the site by clicking on a google ad, the hit will be counted as organic traffic. In these cases, the document location (dl) changes and the document referrer (dr) does not. Google checks the dl first and after that, goes to dr to identify the traffic type.
  • Simo told us about a way by which we can persist the dl in order to have a consistent data collection. All of this made possible using Google Tag Manager.
  • I think Simo Ahava has this intention of humiliating us by showing us how much we are supposed to know and the amount that we already know. The lesson about custom tasks was barely understandable for me in the first play. You know, I understood the process and the things that he was doing were great. But when I wanted to try them myself, things became very messy.
  • Anyway, I know that we have a thing named tasks in google analytics and a sub-branch of it is named customTask. Simo showed a list of tasks that are available for use and told us that customTask will let us do the things that are not defined before.
  • By using custom tasks, he ran a bunch of tests and for example, sent a hit to multiple properties which were great. He said that tasks let us modify and manipulate hits before they are gone from the website and this way, we can do whatever we want.
  • He was quite excited about the lesson he was teaching and I think I (and others like me) was struggling to understand what he was trying to teach.
  • And afterward, he humped into google tag manager and implemented the tasks he previously had done in the browser console. Things became more complicated in this step a little bit, but he summarized it and started the next thing.
  • He told us about a tool that he has developed that is a custom task maker and will give us the chance to do the things that he has prepared before. In the tool, we can just select the tasks we like and the tool gives us the code to place in the tag manager. Just like that!
  • Do you know what is odd? The strange thing is that Simo refers to an article or two which he has written in the past and tells us to use them for more info. It is very odd and exciting that he can’t find anybody who is more adept at google tag manager or google analytics except for himself. How much time have you spent on getting to this point, man?
  • The next lesson is about advanced eCommerce in google analytics. EEC is a difficult subject in nature, and I am imagining what will happen when Simo wants to go technical about it.
  • As I said, the next lesson was about EEC and it was a big one. Simo said that enhanced eCommerce needs to use a pageview or event to send data to google analytics and he also said his personal preference is to use events to do the job.
  • He talked about the importance of dataLayer and why it is always a better option to send EEC data to google analytics. As you might know, we can also use scraping techniques to do the job. Simo says this technique might work in the short term, but in the long run, we result in inconsistencies and malfunctions in your data collection processes.
  • He then showed us how he does the job and what kinds of data needs to be sent to google analytics and what is the proper order for data to be recognized as true EEC data.
  • Some custom dimensions were sent to a test account using enhanced eCommerce, but the dataLayer was built previously and we didn’t get the chance to know how we should build it ourselves. Simo just said that its documentation is available on google’s dev guides and we can check that.
  • In the end, Simo told us about some deep techniques that came from his own experiences in working with EEC and some of them were really astonishing.
  • I need to rewatch the enhanced eCommerce over and over because it might be one of the most practical ones and it has great tips and tricks for working with this beast that is called EEC.
  • Simo doesn’t like refunds in google analytics EEC at all. He basically believes it is pointless to report and measure refunds in google analytics reports.
  • He also pointed out that sometimes your hit payload might exceed the 8kb limit of the data and as I remember, he advised us to make the hit smaller by removing some of the unnecessary data out of it.
  • The next lesson that was a theoretical one, was focused on the GTM API tool. Simo first told us about what this API is and what it does. He said that it is a programming interface that can be used by different languages (including Python and JS).
  • He elaborated on are use cases of GTM API and whether we need it or not. He said if you work in an agency and need to copy or manage hundreds of tags and triggers, you need to know this API for sure. But if you only need to work with a couple of accounts and/or containers, you’d better don’t think about wasting your precious time here.
  • The API is based on methods and parameters and once you want to use it, you will need to know and leverage all of them. Tag Manager has a comprehensive (and almost up to date) reference document for this API which you can easily find on google.
  • It is very easy to work with this API, at least as it seems to be. You just need to have a general understanding of how GTM works and what is the hierarchy in the tool. For example, you need to know that we have accounts at the top level, and containers and workspaces come after it.
  • Simo promised that the next lesson will be about how to create an API tool for our own. As far as I know, has built a set of tools for Tag Manager using this API which is publicly available. But I don’t know what exactly we are going to build in the next lesson.
  • In the next lesson, Simo showed us how to use this API that GTM gives us. He used the combination of google sheets and App Script. This time again, we need to know about javascript, and lacking the knowledge in this field can be sensed here too (I’m referencing myself).
  • Simo simply connects a google sheet to an app script editor and calls different parts of his tag manager account using the API to build an overview report. It takes him a little bit of time and lots of errors to do the job. But his ingenuity is something that can’t be neglected. It makes me envy him so much. I’m not ashamed at all to say this publicly.
  • In the end, he says that all of these codes are in a repository on Github, meaning that me, you, and everybody can use it for free. This is the meaning of free access to education and Simo knows it more than enough. He is a teacher in essence.
  • Custom Templates are fairly new in google tag manager and to be honest, it is a cool addition that is very well accepted in the community.
  • Simo started talking about how custom templates are made and showed us the editor by which custom tags and variables are made. He also told us why it is always a better option to select or build a tag instead of using custom HTML and putting JS codes in them. Some specific clients will reject some custom HTML tags, and this might lead to failures in your measurement.
  • By using custom templates, you can easily enter a variable and two (sometimes more) and have a lovely user interface. You can also share them with your peers or add them to the library so that others can use them. By doing this, you are literally adding something to the community.
  • After knowing what custom templates are and why they are a good choice to make, let’s follow Simo’s next lesson (a very long one) and find out more about this cool addition. We are going to learn how to make a custom template and it is going to be a technical one (as usual).
  • In the next part, Simo actually created a custom tag template for a site called Adform. He took the site tracking code and turned it into a tag that could be used repeatedly. He used all of the techniques and experience he had in JS and did something like magic right before our eyes.
  • I learned how to use input fields and connect them to the actual code that is being used to create the custom tag template. Simo simply gave the input field a name and then called data.fieldName to connect them. How cool is that?
  • To be honest, I thought creating a custom template should be much more complex, but it wasn’t that much rocket science. It is only a matter of knowing about JS instructions. I am trying to develop this skill and I’m working on it.
  • The good thing about templates is that you can export and share them with your friends and colleagues. Simo showed us how to do this and should we import them into another container. By doing this, you will have access to the newly imported tag in your tags list.
  • This course has come to its end. In the final lesson which was actually a wrap-up, Simo truly mentioned that you have to take your skills to the next level. He named some useful resources like Freecodecamp and Codecademy which are great services for those who want to learn about web programming.
  • I feel the urge to strengthen my JS skills. And also I feel the need to learn Python and SQL because they are absolute must-know for a technical marketer these days.
  • By the way, this course needs to be reviewed over and over again, because it carries so much technical information and nobody can truly digest them in a single run. Simo Ahava put this fact before my eyes that I don’t know much about data analysis and specifically about GTM. This feeling is more constructive than destructive because it leads you to the gaps in your professional skill set. You have to know that you don’t know and only then you can try to fix the issues. I feel thankful to Simo Ahava and I won’t forget this great favor he did to me.
  • Thank you for being with me and tolerating my naiveness. Hope to see you soon.



Mohammad Sammak

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