Node Relationships and GTM

There’s a much easier, native-to-GTM way to do this now: the Matches CSS Selector. Behind this tragically boring title is a simple solution to many problems with Google Tag Manager’s auto-event tracking. The common denominator to these problems is poor website markup. Selectors are used sparingly, and element hierarchy is messy. This disregard for proper node relationships means you have to resort to Data Layer Variable Macros which look like Read More…

Custom Event Listeners for GTM

(UPDATE 1 Oct 2014 Due to a change in how macros work in Debug Mode, the {{generic event handler}} macro no longer works when testing in Debug Mode. That means that you’ll have to test your custom listener in a live container (I know, ouch!). If you want to test in Debug Mode, you’ll have to skip using the {{generic event handler}} as a macro, and instead copy the inner function into the Custom HTML Tag, give the function a name, and use that as the callback in addEventListener or attachEvent. Read More…

JavaScript 101 for GTM: Part 2

It’s been an awesome summer, with temperatures soaring in the global warming range throughout our northern country. The heat has given me ample reason to not be near a computer, but now it’s time to mine some JavaScript wisdom again. Here’s the second part of my JavaScript for Google Tag Manager series. The first part focused on GTM specific tips and tricks, and I hope that while reading it, you were treated to another grand example of the flexibility of this wonderful tool. Read More…

Internalize for Google Analytics V1.0

I created a new Chrome Extension: Internalize for Google Analytics. This is its very first version. It only works on websites with Universal Analytics. Click here to download Internalize for Google Analytics v1.0 The idea is that with the extension you can push a custom dimension value to your currently active session. You can then use a profile filter in GA to block traffic with this custom dimension value. It’s useful when blocking internal traffic with more traditional means (IP address or various GTM workarounds) won’t work. Read More…

Fix GA Site Search With Google Tag Manager

Analyzing what people write in your site search field is pretty much one of the smartest things you can do for your website tracking. If certain terms pop up over and over again in internal search reports, it means that your site is not providing the answers people are looking for, meaning you have an excellent opportunity to provide supply for the demand! However, not all site search applications are trackable out-of-the-box. Read More…

JavaScript 101 for GTM: Part 1

Here’s the link to part 2 of this JavaScript guide. The thing about Google Tag Manager, or any JavaScript tag manager for that matter, is that there’s JavaScript involved. In fact, the tool itself is just a JavaScript library with some additional bells and whistles (such as a management UI). This means that to make the best of it, some knowledge of JavaScript is warranted, and that’s the point of this post. Read More…

Send Mail Upon Google Tag Manager Event

Let’s say you want to set up a rudimentary email alert system in your Google Tag Manager implementation. Say, for example, you want to receive an email every time an uncaught error occurs on your website. It’s not a very good use case, since a large website can spawn hundreds of uncaught exceptions in a short period of time, but let’s just pretend for now. If you know your JavaScript, you’ll know that you can’t send mail using client-side code. Read More…

Google Tag Manager: DOM Listener

In this post, I’ll walk you through a tutorial on how to create a Google Tag Manager extension. This extension will be a new listener, whose sole job is to listen for changes in the HTML and CSS markup on the page. The reason I’m teaching you how to create a DOM listener is simple. Ever so often I come across people asking for help, but they are unable to touch on-page code. Read More…

The Container Snippet: GTM Secrets Revealed

First of all, I’m sorry for the wacky title. Sometimes I just want to amuse myself. Nevertheless, this post is about the Google Tag Manager container snippet. There’s nothing secretive about it, but I’m betting many people have no clue what the snippet really does. That’s the revelatory part. If you’ve never wondered what the snippet does, then shame on you! Remember, you own your page template. It’s yours. Any code that you write there is your responsibility. Read More…

Some Awesome Google Tag Manager Resources

When push comes to shove, I’m a pretty lazy guy. I enjoy nothing more than just to stretch my legs on a couch, pick up my iPad, and read what’s going on in the world. I skip the news, since they’re just full of depressing stories. Instead, I head over to my favorite Google+ communities to see what’s new in the blogosphere. This approach has led me to some pretty amazing individuals, whom I follow like a suckerfish. Read More…