#GTMtips: Add the "Event" Key to DataLayer Pushes

In Google Tag Manager, every single Tag requires a Trigger to fire. Every single Trigger requires an Event condition to activate. Sometimes, these Event conditions are obfuscated under template semantics, but you can also create a Custom Event Trigger, where you specify the value of the ‘event’ key in dataLayer that fires your tag. You can read more about the relationship between GTM events and Tags in these two posts: Read More…

"Matches CSS Selector" Operator in GTM Triggers

Be honest, can you think of anything that’s more unfair than this: A new Google Tag Manager feature, published at 02:07 AM my time, and with an easter egg hunt involved?! Of course it was the infuriating Charles Farina who found the new feature and claimed the prize. Curses! (Just kidding Charles, you’re still awesome.) Anyway, there’s a new GTM feature in town, and oh boy, this time it’s a big’un! Read More…

Leverage UseBeacon and Beforeunload in Google Analytics

This nifty little solution will let you calculate the time spent on pages that are not tracked in Google Analytics by default. These include both bounced landing pages and exit pages. Bounced pages and exit pages lack the necessary subsequent pageview, which Google Analytics uses to calculate time-based metrics. Before you go on, read this excellent article by Yehoshua Coren: REAL Time On Page in Google Analytics Yehoshua gives a very nice use case for the technical solution I’m about to explore. Read More…

#GTMtips: Track File Downloads in GTM V2

In this #GTMtips post, we’ll go over a simple method for tracking file downloads in Google Tag Manager, specifically the new, V2 interface. Also, “tracking file downloads” means sending Events to Google Analytics, so this is a GA for GTM guide as well. Tip 15: Set up file download tracking in GTM Since we’re using Google Analytics as the tracking platform, we’ll need the following ingredients to make this setup work: Read More…

#GTMtips: Track Outbound Links in GTM V2

NOTE 30 Oct 2019: I’ve published a new article on outbound link tracking in Google Tag Manager, which makes the whole process much, MUCH simpler. I strongly recommend you read that article instead. Tracking outbound links is important for many. Identifying the exit paths is almost as important as tracking entrances. In this simple #GTMtips post, I’ll show you how to track outbound links with a simple Trigger + Auto-Event Variable combination in the new Google Tag Manager interface. Read More…

RELEASE: GTM Tools V2.0

(UPDATE 3 Apr 2017: There is a newer version of GTM Tools out, so please ignore this article and read this one instead.) So, the time has come to update my GTM Tools. I released the first toolset in October 2014, and it performed its duties just well enough. Sure, the UI was ugly as hell, and there were bugs along the way, but for cloning containers, macros, and rules, and for visualizing containers, it was just good enough. Read More…

Enrich SERP Results Using GTM

Google has a myriad of ways to make the search engine results page (SERP) livelier. When you input a search query, the engine’s mission is to provide you with the most relevant information with as few clicks as possible. Often, this means that you’ll see the answer to your query directly in the SERP: See also Dr. Pete’s excellent description of variation in the SERP (note that this post is from 2013, and not all the data types are relevant today). Read More…

#GTMtips: Create a Generic Event Tag

With Google Tag Manager, there are a million different ways to make your tagging setup leaner and more flexible. The reason this should be a priority is because the UI isn’t perfect. The more tags you have, the more difficult it becomes to manage your assets. In this #GTMtips post, I show you one of my favorite ways to put your container on a diet. Tip 13: How to create a Generic Event Tag I’ve seen a lot of containers that suffer from the same problem. Read More…

Variable Guide for Google Tag Manager

(Updated 21 February 2019) The current version of Google Tag Manager was released in October 2014. With the release, we saw a brand-spanking new UI, a lot of new functionalities (revamped auto-event tracking, for example), plus a new terminology to cope with. We moved away from the programming-centric concepts of Macros and Rules to the more tactile variables and triggers. It’s difficult to rank the changes. The new Auto-Event Tracking is perhaps most impactful, but the improvements done to triggers and variables, when compared to the previous version of GTM, require attention as well. Read More…

Track Content With Enhanced Ecommerce

My fingers have been tingling to write this article. Ever since I implemented Enhanced Ecommerce on my blog a couple of weeks ago, I’ve been getting such an impressive amount of useful data that it’s mind-boggling. In this article, I’ll walk you through the steps I went to implement the solution, along with examples of the data I can now access through Google Analytics’ reporting interface. As you might have guessed, if you’ve read my articles before, I implemented Enhanced Ecommerce with Google Tag Manager. Read More…