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

#GTMtips: Rules in a Nutshell

Rules are the cornerstone of Google Tag Manager. As with any critical element in a system, they are easy to get wrong. This tip is just a refresher on how GTM firing and blocking rules work. Tip 3: Google Tag Manager rules in a nutshell So, let’s go through these points one-by-one. Every tag requires a firing rule to work - this is a given. Without a firing rule, your tag will not be written in the document object, and it will never be executed. Read More…

#GTMtips: Check {{Referrer}} for Previous Page URL

Here’s a simple way to check what was the source of the visitor’s arrival to the current page. It’s done by utilizing the {{referrer}} macro, which comes out-of-the-box in any GTM setup. Tip 2: Use {{referrer}} to see where the visitor came from You might want to also explore the Component Types and create new macros for {{referrer path}} and {{referrer host name}} for example: By default, you see, the {{referrer}} macro returns the entire URL of the previous page. Read More…

#GTMtips: Save GATC in a Constant String Macro

I wanted to try something new (and, naturally, I’m running out of content ideas), so let me introduce the hashtag #gtmtips. I hope others contribute as well, but I will be adding a new tip as often as possible. I’ve got maybe 20 tips in store right now, and I’m writing new ones all the time. So without further ado, here’s… Tip 1: Save GATC In A Constant String Macro This is an easy one, and everyone should already be doing this in one way or another. Read More…