#GTMTips: Track JavaScript Errors as Events

Back back to the friggin’ basics. Almost two years ago, I wrote a two-parter on how to have fun with Google Tag Manager: Part 1, and Part 2. The first part had a nice exercise for tracking JavaScript Errors as Google Analytics Events, using the recently published “JavaScript Error Listener” Tag. Well, that was in GTM V1. Now we’ve been smoothly sailing with the wonderful new interface for well over a year, and it’s time to update some of these nifty tricks. Read More…

#GTMTips: Check if DOM Ready or Window Loaded Have Fired

Every now and then I run into a problem which needs some creativity to find a fix. When choosing a course of action, I tend to land first on an extremely complicated solution. However, if I’m patient enough, I manage to whittle it down to something far more manageable and efficient. In this #GTMTips post, I’ll show you one of these extremely simple solutions to a problem which you might normally overcomplicate. Read More…

#GTMTips: Be Careful With the Tracker Name Setting

Hello friends! Today I want to direct your attention to a dangerous setting found within the bowels of the Universal Analytics Tag template in Google Tag Manager. In fact, GTM itself highly discourages you from meddling with it: I actually agree with this warning. It should be highly discouraged, as modifying the tracker name introduces a potential hazard to your tracking plan, unless you know what you’re doing. Read More…

#GTMTips: Data Layer Variable Versions Explained

Google Tag Manager’s Data Layer is something I’ve touched upon in pretty much all of my articles. It’s such an integral part of what makes a tag management solution great and applicable to a host of business scenarios. I’ve also talked at length about the internal data model of Google Tag Manager, and this #GTMTips post is very much related to this rather murky concept. In this post, we’ll go over the Data Layer Variable Version selection, and I’ll try to explain just what this selector does. Read More…

#GTMTips: Track Launch Campaigns in GTM for IOS

In Google Analytics for iOS, there are two types of campaign measurement. There’s install campaign measurement, which lets you track the channels which brought your visitors to the App Store, where they proceeded to download your app. There’s also launch campaign tracking, which lets you attribute app launches to specific campaigns. In this tip post, we’ll tackle the latter. We’ll leverage a feature of the Google Analytics iOS SDK to build the parameters, and then push them to dataLayer so that they can be used in the Tag. Read More…

#GTMTips: URL Source in the URL Variable

One of the less-known features of Google Tag Manager, a hidden gem if you will, is the URL Source setting in the URL Variable type. It lets you parse any URL String for its components. Tip 38: Parse URL strings with the URL Source setting The setting itself is easy to find. Just edit an existing URL Variable, or create a new one. Then, scroll down to the More Settings divider, expand it, and you’ll see the URL Source drop-down list. Read More…

#GTMTips: Multiple GTM Containers on the Page

For some reason, you might run into a situation where you need to add multiple Google Tag Manager containers on the same page. Usually this is because of poor governance or an inflexible organization. My recommendation is to fix things in your projects first, and only resort to multiple containers if you can’t seem to resolve your governance issues using your vocal cords (or your fists). Officially, Google Tag Manager introduced support for adding multiple containers earlier in 2015. Read More…

#GTMTips: GTM Container Snippet in the HEAD

(UPDATE 28 Sep 2016: The official recommendation has finally caught up with the times. Now the correct placement for the JavaScript methods of the container snippet is, indeed, in <head>.) I want to address something I’ve been confused about from the very first day since I started using Google Tag Manager. Why on earth would an asynchronously loading JavaScript library be recommended to place in the beginning of <body>, when the logical place to start loading dependencies is as early as possible in the document load process? Read More…

#GTMTips: Useful GTM for IOS Tips

A while ago I wrote a blog post about how to install Google Tag Manager for iOS using the Swift programming language (you can read the article here). I’ve been doing a lot of work with Swift lately, and I’m more and more convinced that GTM is actually a very powerful utility for running in your iOS app instead of the Google Analytics SDK. Why? Because it abstracts a lot of the nitty-gritty you’d otherwise need to explicitly manage in your GA installation. Read More…

#GTMTips: Referral Exclusion on Receipt Page

You might have noticed that the Referral Exclusion List in Google Analytics is difficult to maintain. You can’t copy a list from one property to another, the list is a wildcard match for domain names (so all subdomains are automatically excluded), and it’s just about the clunkiest user interface we’ve seen since ERP tools from the 1990s. A while ago, I wrote of a solution which lets you manage referral exclusions using Google Tag Manager, and it’s still a neat trick, as it’s way more flexible than said clunky UI. Read More…