20 september 2016
Must-have Google Tag Manager import container (sept 2016)
Most of my readers know I've been using Google Tag Manager since the day it was launched, I think it was literally the first day. I've published some articles in Dutch in the past, most of them very practical (see all my Google Tag Manager articles). I now intend to publish a small series on Google Tag Manager topics in English, mostly because I'm getting a lot of questions. I like to be practical, so most of what I'll publish is going to be pretty hands-on. However there are also some more strategical choices I'd like to discuss.
For now, these are the topics I have in mind:
- 1: Must-have import file with alle basic elements (with updates for latest changes) (this article)
- 2: Using Google Tag Manager for multi-sites
- 3: When to use what variable
- 4: Common mistakes non-marketeers (developers:) make using GTM
Ideas? Send them to me.
Must-have Google Tag Manager import container
So this is the first article in the series, extremely practical, this one. I build an import container file which will save you a lot of time.
Download import container here
It includes all of the below elements, I included some explanations. First off:
- This is not a drop-in solution! You need to know your way around Google Tag Manager, mostly because you WILL need to change some things to match your specific case/website. If you have no idea what you're doing, you're better off building a Tag Manager container from scratch to learn.
- This import container is intended to save you time and start off with some nifty building blocks, that's it.
- All elements (tags, triggers, variables) that (potentially) need to be changed have the text 'CHANGE' in it
- We almost never use Folders in Google Tag Manager. It feels like a lot of hassle with no clear advantage (even if a container has 200 tags). In stead we use clear naming-conventions.
- We like to use DOM ready as a trigger for checking a pageview. The main reason is that sometimes not all necessary data is loaded on what Google calls the Pageview.
Tag: ADJUST Conversion - adwords - email link click
We check if an email link is clicked and if so: generate an Adwords conversion. Please note that even after a click, someone can still decide not to send the email (and no actual conversion is generated, but it would still be counted by Adwords). We use this as a fall-back if no other conversion types are available on the website (in which case there is work to be done :).
Tag: ADJUST Conversion - adwords - phone link click
We check if a phone link is clicked and if so: generate an Adwords conversion. Bear in mind that on desktop, these links are not used very often, so this is mostly useful for tracking mobile conversions. However this has the same drawback as email links (people can click it and then decide to abort).
ADJUST Conversion - adwords - transaction
Another Adwords conversion tag, based on a completed transaction (in this example we use a DOM ready trigger to check if the transaction has succeeded, but this could off course, preferably even, also be a dataLayer event). We get the transactionTotal from the Enhanced Ecommerce Transaction tag. If you are not using this, you should change the variable.
Tag: Conversion - UA - email link click
Same as above, but generates a Google Analytics event in stead of an Adwords Conversion. Don't forget to add the event as a Goal in Google Analytics.
Tag: Conversion - UA - phone link click
Same as above, but generates a Google Analytics event in stead of an Adwords Conversion. Don't forget to add the event as a Goal in Google Analytics.
Tag: Event - UA - button clicks
This tracks all clicks on buttons using the class 'button' and generates a Google Analytics event.
Tag: Event - UA - downloads
This tracks downloads of PDF, XLS(X) and DOC(X) files and saves them as Google Analytics events (using JavaScript from Simo Ahava).
Tag: Event - UA - outbound link clicks
I really like this one myself. It checks if the link clicked is a link on the current domain and if not: generates a Google Analytics event with all outbound link clicks in it. This logic is extremely usefull for multi-sites, to be discussed in a later article.
Tag: Tracking - adwords - remarketing
Pretty straightforward: just implements the Adwords remarketing pixel on every page. You need to adjust the google_conversion_id (we recommend using a variable for this because you might need this later a lot, eg when implementing Dynamic Remarketing).
Tag: Tracking - facebook - base pixel
Just implementing the Facebook pixel on every page. Don't forget to adjust facebook_pixel_id. Note that to measure conversions, you need to add extra tags.
Tag: Tracking - UA
The Universal Analytics base tag. A few things you'll notice:
- We use a variable for the Tracking-ID. This is useful because you'll use this a lot (eg Event Tracking). We use a look-up table for this. The main reason is that this prevents the tracking code from being fired on staging enviroments for example.
- We set these fields: anonymizeIp, siteSpeedSampleRate, forceSSL. All common sense from our perspective. We also enable Enhanced Ecommerce and Display features.
That's it. I'll probably add stuff in the near future.
Download import container here
Note: we are never ever responsible for misconfigurations caused by the use of our container.