#GTMtips: Migration to V2 Using the Migration Assistant

On March 30th, right on (the latest) schedule, the Migration Assistant tool was published for Google Tag Manager V2. This tool lets you opt-in to account migration for your legacy Google Tag Manager Accounts. Migration means simply that the accounts will be converted to V2 accounts, and you will have access to all the new features the upgrade provides. In this #GTMtips post, we’ll go over the migration steps (it’s pretty simple), and I’ll leave you with a couple of tips on how to get started with the new features. Read More…

#GTMtips: Debugging Tag Execution Properly

One of the unfortunate misunderstandings regarding the wonderful Google Tag Manager Preview mode is what it actually means when GTM reports “Tags Fired On This Event”. For many, this seems to indicate that whatever code the Tag was meant to execute also completed successfully. However, this is not the case. Tip 19: Debugging Tag execution vs. actual requests Let’s get the distinction straight right away: Google Tag Manager debug panel tells you when a Trigger has been invoked by certain conditions, and the Tag which uses this Trigger has its JavaScript injected into the Document Object Model. Read More…

Send Weather Data to Google Analytics in GTM V2

In 2013, I wrote a guide for Universal Analytics and Google Tag Manager on how to poll for weather conditions, and send this information to Google Analytics as a custom dimension of the session. The guide was intended as a technical introduction to Google Tag Manager, and I think it succeeded in that. However, GTM has changed a lot over the last 1.5 years, and I’ve made some improvements to the method along the way. Read More…

#GTMtips: Track URL Fragments as Pageviews

(Updated 15 July 2015: Added a huge simplification. Jump straight to the update at the end.) URL fragments are strings of characters that follow a hash mark (#) in the URL. Typically, they are used for anchor links, where following a link keeps you on the same page but jumps the browser to some anchored position. They’re also the tool of choice for single-page apps, where content is served dynamically without page reloads. Read More…

#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: Setting Google Analytics Fields in GTM

Due to a recent change in the UI (see entry for February 12, 2015 in the release notes), the large and ever-expanding group of fields you could set for your Universal Analytics tags has been mostly removed. Instead, the often obscure Fields to Set selection has been promoted to the top of More Settings, and you control most of the Universal Analytics fields through this selector. In this #GTMtips, we’ll take a quick look at what’s changed, how it’s changed, and how to work with this new, slimmed-down tag template. Read More…

Dynamically Added Meta Data Indexed by Google Crawlers

Quick history. On May 23, 2014, the following announcement was made on the Google Webmaster Central Blog: Read the full announcement here. Anyway, since I see the world through GTM-tinted shades, I instantly figured that this should extend to not only the presentational layer, but to semantic information as well. At the time, I was thinking in terms of the Search Engine Results Page (SERP) and the Meta Description, which prompted me to ask the following in Google+ from Gary Illyes, who made the announcement: Read More…

Track Non-JavaScript Visits in Google Analytics

One of the big mysteries in browser-based data collection platforms like Google Analytics is what happens when the visitor is not being tracked. This is most obvious in cases where the user explicitly opts out of tracking, when the user does not have JavaScript active in their browser, in bounced sessions, and on exit pages. Opt-outing means that the user explicitly prohibits a website from tracking them. In some cases, it’s possible that opt-out is the default, and the user must explicitly opt-in to allow GA to record their visits. Read More…