Time flies by. It’s been 9 weeks when I started CXL’s digital analytics degree program. I’ve learned a lot so far. A lot of new and challenging things. One of the most entertaining and informative teachers is Chris Mercer. I’ve learned Google tag manager and now I’m taking Intermediate Google tag manager. Then there’s Advanced Google tag manager is Simo Ahava. I didn’t know how big and important Google tag manager was. Now I know it’s very important when it comes to website tracking. Intro showed all the basics of Google tag manager. Intermediate showed what more we can do and Advance tag manager portion shows what we can do outside of Google tag manager basics and how we can use it for more advanced business level objectives.

In Simo Ahava’s Advanced Google Tag Manager course, he goes way further and show way more advanced things you can do with Google tag manager. Most marketers and tag manager users probably don’t even realize how far you can utilize tag manager. Simo takes this to the next level. This was definitely the hardest course to understand. I was completely lost the entire way haha. The course was filled with JavaScript programming. I know of it but I have no experience of using it. This is something I have to learn. As a marketer, I never thought about learning JavaScript or other programming languages. To be a top 1% marketer, I’ll definitely need to get out of my comfort zone and learn programming. I feel lazy and I need to push myself hard to learn and practice.

Simo starts out with talking about event tracking and using it’s true power under the hood. He explains how to understand in depth data layer push, how to use auto event tracking efficiently and solve issues with auto event tracking. Google Tag Manager automatically collects user interaction events.

What happens when you execute a dataLayer.push() — and understanding this is crucial if you want to build and design complex Google Tag Manager implementations.

How to use auto-event tracking effectively — and why this is one of the most useful ways to put Google Tag Manager to use on a site.

How to solve issues with GTM’s auto-event tracking — and how you can save hours of detective work once you figure out the common reasons for why event tracking breaks.

We use this code for data layer event tracking

window.dataLayer.push({ event: ‘custom_event’, key : ‘someValue’ });

Google Tag Manager’s default events: are Page View: Pushed in the container snippet, fires when the container has loaded. DOM Ready: Pushed when the page HTML has been rendered in the browser. Window Loaded: Pushed when the page has completely loaded.

Custom Events are deployed with dataLayer.push({event: ‘customEventName’});

Simo goes on to explaining that A dataLayer.push() without an ‘event’ key is registered as a “Message” — meaning it is only metadata and has no triggering capabilities of its own.

He goes further explaining custom event listeners.

  • How the JavaScript event handling model works — and how you can utilize it to fix issues with tracking form submissions, for example.
  • What different types of browser events can be tracked — and just how much potential there is in tracking these with Google Tag Manager.
  • How to build your own event listeners — sometimes GTM’s own native auto-event listeners are simply not enough.

To add a listener to directly to tracking elements, we use the following code-

var el = document.querySelector(‘h1.postShorten-title > a.link-unstyled’); el.addEventListener(‘click’, callback, true);

We can do things like checking if a key was pressed of if the users wrote a seuence of keys. We can track mouse events like clicks, copy text, buttons clicks. Provides good info for website owners to see what users are doing. These trackings are also useful for marketers such as myself. Simo says to place code higher up in the code tree to delegate important events first.

In Simo’s course, I was also able to understand why Google Analytics uses a tracker object, how the tracker object works in GTM and Identify and debug issues with single-page apps.

Google Analytics uses a tracker object data structure to make sure that interactions on the website are compiled into well-formed Google Analytics requests and hits.

He addresses:

How the tracker object works — and why it’s such an important asset in building Google Analytics tracking on a website.

How the tracker object interacts with Google Tag Manager —GTM has an idiosyncratic approach to how it utilizes the tracker object.

  • How to identify and fix issues with single-page applications — the biggest problem is how to measure single-page applications correctly in Google Analytics, when using Google Tag Manager as the implementation tool.

We use ‘create’ to create a new tracker object. ‘send’ is used to dispatch a hit to analytics. We can have multiple tracker objects running on the page.

He further explains about tasks. How we can create custom taks like PII removal update sessions cookie and hit multiplication plus more.

Here are the following tasks in GTM;

custom task- has not functionality of its own. we use it to manipulate a model object.

preview task

check protocol task

validation task

check storage task

history import task

sampler task

build hit task

send hit task

timing task

display features task

My goal one day is to have my own ecommerce store. Simo goes over enhanced Ecommerce. He covers the role of the datalayer in enhanced ecommerce and how we can use the custom javascript variable method. Google tag manager enforces a rigid syntax for the datalayer in an enhanced ecommerce push.

I learned that product list can be sent with any ecommerce action hit, but it should be sent with product impression views and product clicks. In order to be attributed to the correct list, the Product iD has to stay constant through all actions within the same session.

In the intermediate course, Merce goes over Google Tag Manager’s programmatic API. Simo goes more advanced in depth about GTM’s API. What we can really do with it. We can use to create our own customized solutions. It’s really cool what he does but it’s complicated to understand. We can automate alot of things. It’s great to update 100’s of containers.

Google Tag Manager’s API allows us to create scripts that handle account/container management operations. Simo shows us some practical examples of what we can do with Google Tag Manager’s API. I learned a lot from this.

--

--

Newaz Chowdhury

One of the founders of Powerphrase Applications. Graduate in Business Economics, now moving forward into application development. Born in Canada, living in Cali