Two Ways to Persist Data via Google Tag Manager

The web is stateless. It’s basically blind to your past, and it does a poor job of predicting what you might do in the future. When you browse to a website, the browser requests the page from the web server, and then proceeds to render it for you. This is a detached, clinical process, and any personalized or stateful data transfer is left to the sophistication of your web server. Read More…

#GTMTips: Product-Scoped Custom Dimensions and Metrics

With the advent of Enhanced Ecommerce for Universal Analytics, a new scope was introduced for Custom Dimensions and Metrics. Product scope can be used to send information about each product that is sent through Enhanced Ecommerce, but it’s not exactly the most logical or intuitive thing to wrap your head around. In this #GTMTips post, we’ll take a look at how to implement Product-Scoped Custom definitions via Google Tag Manager, and I’ll quickly explain how they work in relation to queries and reports you might want to build on top of them. Read More…

#GTMTips: Block Your Tags With Trigger Exceptions

To prevent a Tag from firing in Google Tag Manager, you can: Delete the Tag Remove all Triggers from the Tag Add an Exception Trigger to the Tag The third option is usually the best if the blocking is just temporary. Exceptions are what used to be called blocking rules in the first version of GTM. To add them is easy enough. In the Fire On step of Tag creation, you can click Create Exceptions, and choose the Trigger that will block this Tag from firing. Read More…

Form Field Timing With Google Tag Manager

The inimitable Craig Sullivan gave me an idea for a continuation to my latest post on form abandonment tracking. In this short tutorial, I’ll show you how to track the time users spend on your form fields. We’re going to use the User Timings hit type, and we’ll send the data for just one form. With small modifications, you can expand the script to cover multiple forms on a page. Read More…

Track Form Abandonment With Google Tag Manager

Form abandonment isn’t always easy to define. Most often, it refers to when someone starts to fill in an HTML form, but leaves the page without submitting it. As a definition, this works nicely. However, with multi-page forms it naturally refers only to the last page of the form. Also, especially with government institutions, forms can be saved to be submitted later. Here, again, form abandonment must be reconsidered. In this article, I’ll go over four different ways to track form abandonment in Google Analytics, using Google Tag Manager to setup the tracking. Read More…

#GTMTips: Access Array Members in the Data Layer

In JavaScript, if you want to access an Array member, you use square bracket notation to retrieve the value stored at a specific index. Indices are numbered in order, with the first index always being at location zero (0). This means that to get the first value stored in Array simo, you’d use something like: var firstValue = simo[0]; In Google Tag Manager, you can push Arrays into the Data Layer. Read More…

#GTMTips: Implement Referral Exclusions via GTM

Maintaining the list of Referral Exclusions in Google Analytics admin is a pain. Especially if you have a webstore, the number of referral sources you need to exclude to avoid sessions being split can grow really fast. Also, it’s not like the list is has the most intuitive UI. Instead of a handy text area where you could just copy-paste stuff, you’re left with a horrible line-by-line list, and there’s no way of copying lists across properties or anything useful like that. Read More…

Folders and Syntax Highlighting in Google Tag Manager

What a nice way to wake up to a new day, when brand-spanking new features have been released for Google Tag Manager. The two features I want to introduce here are Folders in the UI, and code syntax highlighting in Custom HTML Tags and Custom JavaScript Variables. Folders Folders is one of those features that has been requested for over and over again since day one. The UI clutter in GTM is a serious problem, especially when dealing with dozens and dozens of items in a single view. Read More…

Measure Cart Value in Enhanced Ecommerce

One of the glaring omissions in the Enhanced Ecommerce reports of Universal Analytics is the ability to calculate cart value for products. Cart value, here, is the value that has been added to the cart. This value can be used to query for products that have the highest discrepancy between cart value and generated revenue. These are missed opportunities of the highest caliber. With some Custom Metrics magic, we can, however, get cart value into our reports, and we can find our most and least “effective” products with just a glance: Read More…

Enhanced Ecommerce With a Custom JavaScript Variable

Enhanced Ecommerce is a very nice improvement to the pretty lame, transaction-based Ecommerce tracking in Universal Analytics. Instead of staring blindly at what happens on a receipt page, Enhanced Ecommerce expands your entire webstore into one large funnel labelled “Shopping Behavior”, and you’re able to zoom in on the Checkout funnel as well. Also, the addition of product-scoped tracking is incredibly useful, and it’s enabled us to think of any asset (our content, for example) on our site as something we could track through the Enhanced Ecommerce reports. Read More…