User Distributor Custom Tag Template for Google Tag Manager

I’ve enjoyed working with custom templates for Google Tag Manager. A lot. So much so that whenever the need to add some custom code to a container emerges, my first thought is how to turn that into a custom template. Google has been forthcoming in introducing new APIs steadily, and I think the variety of things you can do with template is improving with every new API release. In this article, I’ll show you how to use a simple tag template for distributing your users to groups, based on a random split. Read More…

#GTMTips: When Click Variables Are Undefined

A surprisingly common question in forums and communities seems to be why the built-in Click variables show up as undefined in Google Tag Manager’s Preview mode, even if you click around the site. In this article, I’ll walk you through some of the reasons why this might happen. Tip 104: What to do when Click variables are undefined Here’s the situation: you want to create a Click trigger for your tags, but in order to do so, you’d need to see what values the built-in Click variables (e. Read More…

IOS Quickstart With Google Analytics for Firebase and Google Tag Manager

A while ago, I published an article on how to build an Android application, and bundle it with Firebase. The purpose of that article, and the one you are reading now, is to slowly introduce the world of mobile app development and Firebase, given the latter is getting more and more traction as Google’s go-to analytics platform. After finishing work on the Android guide, I immediately started working on its counterpart for iOS, and that’s the one you’re reading now. Read More…

Android Quickstart With Google Analytics for Firebase and Google Tag Manager

With the release of Google Analytics: App + Web, Firebase is suddenly all the rage. The new App + Web property can combine data from your website and mobile apps, as long as the latter uses Google Analytics for Firebase, formerly known as Firebase Analytics. In this guide, I’ll walk you through the steps of creating an extremely simple Android application, and we’ll then create a Firebase project, and for good measure add Google Tag Manager to the mix. Read More…

#GTMTips: Get Latest Exchange Rates for Client-Side Conversions

It’s been a while since I’ve last written a bona fide Google Tag Manager trick, so here comes. This was inspired by Bart Gibby’s question in Measure Slack. The purpose is to fetch the latest currency exchange rates from the exchangeratesapi.io service, cache them using sessionStorage, and push the results into dataLayer. From dataLayer, they can then be utilized in Custom JavaScript variables and custom variable templates to perform client-side conversions. Read More…

Getting Started With Google Analytics: App + Web

Google recently released a new version of Google Analytics called App + Web. Clumsy name aside, this really is for all intents and purposes Google Analytics V2 or Firebase Analytics for the Web. We’re not talking about a charming way to do roll-up reporting between Google Analytics for Firebase and Universal Analytics, nor are we talking about an enhancement to Universal Analytics. No, we’re talking about a new measurement model for web traffic, which has the convenience of being compatible with Google Analytics for Firebase, which you might already have running in your apps. Read More…

#GTMTips: Enable Preview Mode in the Safari Browser

With Intelligent Tracking Prevention, the Safari browser is on a crusade against cross-site tracking. One of the most obvious and long-standing ways to battle cross-site tracking has been to block third-party cookies in the web browser, and this is exactly what Safari does by default. However, Google Tag Manager’s Preview mode relies on a third-party cookies, so that it can serve you the draft version of the container while serving the regular, live container to your site visitors. Read More…

#GTMTips: Introducing the GTM Templates Library

When Custom Templates were released in Google Tag Manager, many of us active in the GTM communities started doing two things: 1) creating our own custom templates, and 2) waiting patiently for Google to release a “gallery” or “library” for distributing these community contributions. While I have full faith in the latter happening some time in the future, I thought it would be fun to create something similar to a library, and then open-sourcing it for the community to help out with or to download locally for their own purposes. Read More…

How to Build a Google Tag Manager Monitor

Google Tag Manager is strictly a tag delivery system, and it’s very careful not to collect any analytics data on its own. This is most likely a deliberate choice, because if GTM was to start collecting data, it would introduce additional barriers to adoption. Nevertheless, being a tool that consolidates the design, development, deployment, and testing of all the marketing and analytics pixels, code snippets, and utilities running on a website or a mobile app, lacking the necessary features for auditing and monitoring has always seemed like an oversight. Read More…

Enhanced Ecommerce Object Builder Template for Google Tag Manager

One of the cool things about Enhanced Ecommerce deployments in Google Tag Manager is that you can use a Custom JavaScript variable to generate the necessary data. There are many reasons to do so, with the biggest one being the flexibility it offers for manipulating the dataLayer object in case quick changes are required on the site, and it would take too long to wait for a new release of the site JavaScript. Read More…