Customize the Scroll Depth Trigger in Google Tag Manager

Last updated 9 March 2018 with some new tips. The Scroll Depth trigger in Google Tag Manager has a lot going for it. Tracking how far users scroll down a given page has long since been recognized as an important cog in the engagement tracking machine, and there have been really great solutions for implementing scroll depth tracking for web analytics over the years. With Google Tag Manager’s native Scroll Depth trigger, it’s tempting to think we now have a be-all end-all solution that covers all the bases. Read More…

#GTMTips: Add HTML Elements to the Page Programmatically

One of the annoying quirks of Google Tag Manager is that it strips out any non-standard HTML attributes from elements you add to Custom HTML tags. I’m using “non-standard” as a qualifier here, because I don’t have an exhaustive list of attributes that are ignored. But at least data attributes (e.g. data-id) and attributes with custom names (e.g. aria-labelledby) are either stripped out upon injection, or GTM might actually prevent you from even saving the container if the Custom HTML tag has elements with these attributes. Read More…

#GTMTips: Check for Undefined Value

This is one of those #GTMTips posts that I was certain I’d already written. So it came as a mild surprise when I realized I’d never tackled this aspect of Google Tag Manager. It’s a short and sweet tip again. Today we’ll learn how to check if a variable is undefined using Google Tag Manager. Tip 73: Check for undefined variable values If a variable is undefined, it means that a variable with the given name does not currently have any valid value in memory. Read More…

CustomTask - The Guide

Last updated 4 September 2018 If you have been reading my blog articles over the past year, you might have noticed a disturbing trend. I’ve published 9 articles on customTask since the API was released. It might not sound like much, but I can’t think of a single feature in Google Analytics or Google Tag Manager that has so completely convinced me of its usefulness in such a short time. Read More…

#GTMTips: Edit Google Analytics Tag Settings

When the Google Analytics Settings variable was introduced in May 2017, it resulted in a significant change in the Google Analytics tag user interface in Google Tag Manager. The default UI for editing a tag was stripped down of all GA-specific settings, and the new Google Analytics Settings drop-down was the replacement. Unfortunately, the bulk of Google Tag Manager articles online (including those on this blog) still refer to the old interface in screenshots and instructions. Read More…

#GTMTips: Fix Missing Page View Event and Broken Triggers

Google Tag Manager should be relatively easy to implement. Just paste the container snippet to the <head> of the page and you’re good to go! However, at some point you’ll want to configure the dataLayer structure, too (read more about dataLayer here). There are two ways to do it: the right way and the wrong way. In this article, we’ll see what happens if you do it the wrong way, how to identify the issue, and how to fix it. Read More…

Snowplow: Full Setup With Google Analytics Tracking

A recent guide of mine introduced the Google Analytics adapter in Snowplow. The idea was that you can duplicate the Google Analytics requests sent via Google Tag Manager and dispatch them to your Snowplow analytics pipeline, too. The pipeline then takes care of these duplicated requests, using the new adapter to automatically align the hits with their corresponding data tables, ready for data modeling and analysis. While testing the new adapter, I implemented a Snowplow pipeline from scratch for parsing data from my own website. Read More…

#GTMTips: Automatically Duplicate Google Analytics Hits to Snowplow

I’m back with another customTask tip, but this time I’m exploring some new territory. Snowplow just introduced their latest version update, which included (among other things) an adapter for processing Google Analytics payloads. Never heard of Snowplow? It’s a collection of open-source libraries designed to let you build your own analytics pipeline, all the way from data collection, through ETL (extract, transform, load), using custom enrichments and JSON schemas, and finally into your own data warehouse, where you can then analyze the data using whatever tools you find preferable. Read More…

#GTMTips: Simple Custom Event Listeners With Google Tag Manager

First of all, check out this article for an overview of how custom event listeners work in Google Tag Manager. The reason I’m writing this #GTMTips article is that I want to upgrade the solution slightly, and I want to bring it back into the spotlight. Why? Because it’s still one of the most effective ways to customize your Google Tag Manager implementation. A custom event listener is a handler you write with JavaScript. Read More…

New Tools Released

Over the past few weeks, I’ve been coding like crazy. The three biggest outcomes of this frenzy have been this new blog design (switched finally away from WordPress and took the plunge back into the world static sites using Hugo), a new Google Sheets add-on for managing Google Tag Manager containers and assets, and a Slack integration in GTM Tools. In this article, I’ll quickly introduce the last two, as I’m writing a separate article about the site redesign. Read More…