#GTMTips: Add Konami Code to Your Site

You’ve probably heard of the Konami Code. It’s a cheat code in many Konami games, where the cheat is executed with a sequence of key presses on the keyboard. Since then, it’s become one of the staples of video game folk lore, and many websites, games, and applications have their own easter eggs activated with the Konami code. The sequence of keys is: up, up, down, down, left, right, left, right, B, A Read More…

#GTMTips: Prevent Repeat Transactions

In this tip, we’ll take a look at how to leverage a custom first-party cookie to prevent repeat hits of any kind. This is most useful for transactions, since a common problem with Google Analytics (traditional) eCommerce tracking is that a transaction hit is sent again upon subsequent entries to the receipt page, for example using the Back button of the browser. In some cases, and this is not a good practice, a receipt e-mail is sent to the user with a link back to the receipt page, where the transaction is sent over and over again upon entry. Read More…

#GTMtips: Fix Problems With GTM Listeners

I’ve written about this before here and here, but this issue remains probably the biggest problem users have when implementing Google Tag Manager. Tip 10: Resolve conflicts with GTM’s listeners The tip title is actually wrong. You’re not fixing Google Tag Manager listeners. Rather, you’re resolving conflicts that other scripts on your page might introduce. GTM’s event listening is based on something called event delegation. Event delegation makes use of the document object model (DOM) and its tree-like hierarchy. Read More…

#GTMtips: Migrate Containers to New UI

If you haven’t lived in a barrel, you should know by now that a new version of Google Tag Manager has been released. You can find the new version at http://tagmanager.google.com/, and there’s already a bunch of good articles about the new UI out there. I want to point out two: “Setting up GA via GTM’s new UX” by Krista Seiden, and “Google Tag Manager Refresh – 6 Things You Need to Know” by Jonathan Weber from Bounteous. Read More…

Auto-Event Tracking in GTM 2.0

In the new version of Google Tag Manager, auto-event tracking has received a considerable usability upgrade. It might seem quirky at first, especially if you’re used to the old auto-event tracking method, but the logic behind the new setup is brilliant. The most important distinction is that auto-event tracking isn’t something you control with separate tags anymore. Rather, it’s now entirely trigger-driven, meaning you activate and specify the auto-event tracking of your choice using tag triggers (triggers are what ye olde folk used to call rules). Read More…

#GTMtips: Once UserId, Always UserId

The User ID is definitely one of the coolest things about Universal Analytics, if used correctly. It might reveal some surprising insights about your visitors, since now you’re not restricted to analysing visitors as just browser or device instances as before, but rather you can build your stories around all the touch points the user might have had on their journey to and through your web properties. With this simple tip, you can extend User ID tracking to return users without them needing to authenticate. Read More…

#GTMtips: DataLayer Declaration vs. .Push()

Here’s a tip on how to avoid a horrible, horrible mistake with Google Tag Manager. Tip 7: Always use .push() with dataLayer When you assign a value to a variable using the equals ( = ) sign, you are actually reallocating the variable to a new value, and the garbage collection system of the runtime environment sweeps the previous value to bit heaven. Let’s put it simply: if you redefine dataLayer after the GTM container snippet, you will break GTM’s proprietary functions. Read More…

#GTMtips: HitCallback and EventCallback

This time we’ll take a look at two different, JavaScript-y features of Google Analytics and Google Tag Manager. Callback as a concept should be familiar to anyone who’s ever used a programming language. It’s basically a piece of code that is passed as an argument to some function, so that when this second function has completed, the callback is executed. For web analytics, callbacks are hugely important, since they allow you to impose a firing order for your asynchronous tags. Read More…

#GTMtips: Chain Macros in Lookup Tables

One of the cool things about using a tag management solution is that you can leverage variables like never before. In Google Tag Manager, these variables are referred to as macros, and you can identify a macro with the syntax of {{macro name}}. In this tip I’ll show you how you can actually call macros from other macros, using a Lookup Table as an example. Tip 5: Chain Macros In Lookup Tables (And Other Macros) It’s not just Lookup Tables, either. Read More…

#GTMtips: Undefined Dimensions Won't Get Sent

This might not sound like a tip to you. You might think, “Dimensions won’t get sent? Sounds like a bug!”. You’re wrong. This is one of the awesome features of the GA API, and it’s key to making your tag setups leaner when sending data to Google Analytics. Tip 4: Undefined dimensions are left out of GA hits Note that ‘undefined’ here means the special value undefined in JavaScript. Read More…