#GTMTips: Check for New User

Every now and then we want to create a bridge between the stateful machines we send data to (e.g. Google Analytics), and the stateless environment where we collect the data itself (e.g. Google Tag Manager). This is not easy. There is no synergy between Google Analytics and Google Tag Manager which would let the latter understand anything about things like sessions or landing pages or Bounce Rates. One thing we can reliably measure, however, is whether or not the visitor is a New User in Google Analytics. Read More…

#GTMTips: Prevent Tag From Firing in IFrame

Unfortunately, iFrames still exist. They are used to embed content from one page into another. Frames are horrible, nasty things, very often riddled with cross-domain problems, performance issues, responsive design obstructions and other crap from the nether pits of hell. Regardless, if you’re stuck with an iFrame which also collects data to your Google Analytics property, for example, you probably want to prevent at least the first Page View from firing, since otherwise you’ll be double-counting Page Views: once on the main page and once in the iFrame. 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…

#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…

#GTMTips: Remember to Flush Unused Data Layer Variables

Here’s a tip that’s especially important to anyone working with a single-page application. Google Tag Manager persists items in its data model until you either manually delete the variable and/or its value from the data model, or until the user browses away from the page. There’s nothing as annoying as the example in the image below, where a value that was set for an earlier Tag is resent with a new Tag, even though the purpose was to leave it out. Read More…

#GTMTips: Remove Email Addresses From URL Parameters

PII (Personally Identifiable Information) is something we need to actively combat against when using Google Analytics, as the platform explicitly forbids sending PII to Google Analytics properties in any size, form, or shape. One of the most common ways of accidentally passing PII to a property is via query parameters. Many email platforms out there, for example, see no problem in including the user’s email address in the query string, especially when the user follows a link in a newsletter. Read More…

#GTMTips: Take the Google Tag Manager Fundamentals Course

Are you (even marginally) interested in one of the most powerful tag management systems out there? Do you want to refresh your memory on how JavaScript works in the web? Do you want to get the most out of Google Tag Manager as the go-to system for all marketing and measurement tagging on your websites? Take the Google Tag Manager Fundamentals Course at the Analytics Academy, then! And take it even if you have no idea what the tool is. Read More…

#GTMTips: Add Google Tag Manager to Your Blogger Blog

This is a very simple tip, but judging by the number of queries on the Product Forums, it should prove helpful. Blogger is a free blogging service by Google. Like WordPress, they allow you to run hosted blogs on the blogger.com domain, and they also allow you to modify the HTML source. This, of course, means that you can add the Google Tag Manager code to the HTML template, if you wish (and why wouldn’t you! Read More…