Cover photo
Doug Hall
Works at Conversion Works
Lives in London
436 followers|133,848 views


Doug Hall

Sharing  - 
Almost forgot the G+ GTM Community! How remiss of me.

Anyhow, I hope this makes up for it:

Explain GTM - a tool for digital marketers, developers, GTM practitioners, analysts and anyone who wants to get more from GTM.

Please enjoy and measure responsibly.

Google have officially recognised us as experts in driving targeted visitors to your site and then persuading those visitors to take action.
Matt Gaskey's profile photoHussain Mehmood's profile photo
+Doug Hall this is awesome; and great of you to open source it.
Add a comment...

Doug Hall

General Questions  - 
Kinda hopeful feature request...

Tag schedules appear to require a date and a time. I have a scenario where I'd like to fire a tag between midnight and noon only.

Specifying a time but no date fails - no error message but the timing config is not saved:

Adding a date to go with the time works, naturally, and we can see in preview mode that the time stamps are used as blocking triggers:

For time sensitive campaigns, firing based on the hour and minute values relative to the container timezone settings is a handy feature.

For now, until anyone advises otherwise I'll use a custom JavaScript variable calculating UTC times:

var d = new Date();
var n = d.getUTCHours();


Add a comment...

Doug Hall

Sharing  - 
Technical tear down of GA & GTM & Optimizely.

ICYMI, we wrote a GA, GTM & Optimizely 'fire and forget' integration (

Here's the technical detail:

Happy testing!

Google have officially recognised us as experts in driving targeted visitors to your site and then persuading those visitors to take action.
Add a comment...

Doug Hall

Shared publicly  - 
Happy days!
Add a comment...

Doug Hall

Sharing  - 
You may have needed to audit a GTM container or indeed, have been asked to audit a container. In this case, you've had to trawl through lists of tags, triggers and variables paying careful attention in multiple browser windows as to which tag is using which trigger(s) and variable(s). You'll have a list of tags, which variables and being referenced and the triggers involved in each use case. You'l actually have two lists of triggers - firing and exception triggers.

It's a time consuming task when done properly.

Here's a tool to speed up the process.

Here's how to use it:
Paste a container export (raw json) into the text box and press 'Process' -

You'll be presented with three text boxes. Tags, Triggers and Variables:

From bottom to top, you can grab the Variables text and paste the list of variables in a spreadsheet:

You can do the same with the triggers:

Fairly handy so far. Tags offer the most use combining Tags, Triggers and Variables.

Grab the text and save it as a csv file. Import the csv file into a Google sheet:

You then end up with a spreadsheet containing tags (by name), tag type, firing and blocking triggers and the parameters for each tag:

The params are REALLY very useful. Here's an example:

eventValue:{{Event Value}}
trackingId:{{UA - Lookup}}
nonInteraction:{{Event Interaction}}
eventLabel:{{Event Label}}
eventCategory:{{Event Category}}
eventAction:{{Event Action}}

You could even do some Excel/spreadsheet wizardry to sort, filter or split by tag types, tags using certain variables or find interaction or non-interaction events. Your spreadsheet skills will help a lot here.

So, the usual disclaimer, breakage to your GTM container or data are your responsibility. Don't do dumb things. If the GTM guys change the export format, I'll have to fix the tool. Suggestions are welcome, blah know the score.

Hoping you find this as useful as we do and your container audits are less onerous.


Paste Container in here: Process. Tags. Triggers. Variables.
Add a comment...

Doug Hall

Sharing  - 
     I'd like to offer you all the opportunity to use our 'Container Cutter' -

We've found this to be a handy tool to help GTM asset reuse.

There are fice steps:

1: Grab a GTM container export
2: Paste the raw json in the box where it says 'Paste Container in here:' and click 'Process'. (
3: Select the assets you want to 'snip' from the container and click '"snip 'em" (
4: Copy and save the json from the text box
5: Import the container into the GTM account where the 'snipped' functionality is required.

When you select tags in step 3, the triggers and variables used by the tag will be automatically selected. If you unselect tags, you'll have to unselect triggers and variables yourself.

If custom js variables reference other variables, these aren't picked up currently - you'll need to make sure the right assets are selected before clicking "snip 'em".

Of course, anything snipped and imported needs testing.

If the GTM team change the export/import format, l'll need to change the tool to reflect these changes.

Use snipped containers carefully. Test everything. Any breakage of data or GTM encountered when using this tool is your own fault. Don't be dumb!

Having said that, I welcome feedback and ideas.

Thanks and happy snipping!

Dominic Hurst's profile photoJonas Hallgren's profile photoDoug Hall's profile photo
+Simo Ahava Done.

You're welcome ;-)

Add a comment...

Doug Hall

General Questions  - 
Have I found a more-complex-than-it-needs-to-be solution for a question that just cropped up around dataLayer names?

Scenario: Dev agency (in their infinite wisdom) decided to change the dataLayer variable name. Fine. They can and they did but they failed to announce this. Hence, a few customHTML tags fail and cause JS exceptions as they attempt to push data onto the data layer.

So, using a custom JS variable( , I drop this line at the top of the customHTML tag:

window.dataLayer = window.dataLayer || eval('window.' + {{dataLayer Name}});

My issues:
I hate eval. Is there a better way?
Is there a cleaner way of getting the dataLayer variable?
Is this technique even reliable?

Thought I'd share this as it may be of wider interest (Sorry to hassle you +Simo Ahava).


Stephen M. Harris's profile photoSimo Ahava's profile photo
By the sway, Google does still recommend a single container setup. Just because it's in the developer guides doesn't mean you should do it. What it simply means is that since so many people have been messing around with multiple containers, they've now made rudimentary steps to prevent it from breaking completely. But it definitely is not officially recommended (this straight from the GTM team).
Add a comment...

Doug Hall

Sharing  - 
Suspected bug. Please confirm.

Clicking the account button in the top right to log out and then log in to another account is broken. Not functioning. I observe a JS error in the console:

Uncaught TypeError: Cannot read property 'css' of null gtm_compiled.js:972

I've managed to logout by torching cookies so I can still function but this is mildly hampering.

cc +Brian Kuhn and +Lukas Bergstrom 
Doug Hall's profile photoSimo Ahava's profile photoAbiodun Thorpe's profile photoMichael Philpott's profile photo
FYI this should now be fixed.
Add a comment...

Doug Hall

Sharing  - 
May I present for your Thursday reading, a fire and forget GA/GTM/Optimizely integration:

Happy integrating!

Google have officially recognised us as experts in driving targeted visitors to your site and then persuading those visitors to take action.
Matthew Niederberger's profile photoDoug Hall's profile photo
It's coming in the next hour!

Add a comment...

Doug Hall

Sharing  - 
In case you wondered what GTM best practices to employ, here's a FREE book to help you:

Stéphane Hamel's profile photoLuis Perez Alcaide's profile photoDoug Hall's profile photo
Don't look too big on my IPad mini...;-) Formatting is okay too.

Just sayin'
Add a comment...

Doug Hall

Sharing  - 
Remind me on Thursday to make sure I share another neat tool with you.

This tool takes a GTM container and renders it as a csv file - great for auditing containers.
Damion Brown's profile photoDouglas Male's profile photoDoug Hall's profile photo
Add a comment...

Doug Hall

Discussion  - 
Wondering how and if this might affect GTM:

Will variable execution/evaluation be more/less predictable? Async is good for perf and this change looks like good things will happen to speed but will variable usage, especially nesting of user defined variables become problematic?
Always obsessed with speed, Google shared today that it has improved the way Chrome loads Javascript files in the latest version of Chrome, now loading at the same time as beginning ...
Simo Ahava's profile photoChris Martin's profile photoStéphane Hamel's profile photoBrian Kuhn's profile photo
The only way you'd be negatively affected by this is if your setup was already making faulty assumptions about the timing of GTM loading (i.e. race conditions). As long as you're not making any assumptions about how quickly GTM will load, you'll be fine with this change. It should result in better tracking data, especially on mobile web.
Add a comment...
Head on Internet Marketing and CRO
  • Conversion Works
    Head on Internet Marketing and CRO, present
  • Moneyspyder
  • Perot Systems
  • Blue Square
Basic Information
CRO professional
I'm CRO Professional - what is this? Conversion Rate Optimisation is the science of making websites suck less.  This discipline involves:
  • Web technologies
  • Psychology
  • Statistics
  • Analytical skills
  • Web Design

Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Doug Hall's +1's are the things they like, agree with, or want to recommend.
Redirect Path

The HTTP Header & Redirect Checker for SEO


Cars, motorsport and other nonsense. The official Ustream channel of the car podcast Gareth Jones On Speed.

Conversion Rate Optimisation Experts - ConversionWorks - Convert Your Si...

ConversionWorks is a Service that analyses the behaviour of your site's visitors to identify and improve the performance of problem areas an

Nurturing Your Customers & Business with Universal Analytics

Learn how Google Analytics and Universal Analytics can help you nuture your customer relationships and improve your business.

Stuffed pancetta-wrapped pork loin: Recipes: Good Food Channel

Try John Torode's succulent herb-filled loin of lamb when you next fancy a change for your Sunday lunch

We hate the cookie law

A new EU law makes most websites illegal without intrusive popups and banners. We object, and you should too.


Keeping the world informed about motorsport since 1950

Publish sync for google+ & facebook - Chrome Web Store

This is a super top extension, provide two-way syncs Google+, Facebook, Twitter, Plurk. It supports article, video, pictures and web links.

Steve at Chiltern Solar was extremely helpful and patient. The quote was the best in terms of accuracy and price - Steve answered all our questions and gave us sound advice on choosing the right installation. The installation was pain free, very professional, clean and prompt. We're now hapilly generating power and are delighted with our installation. Highly recommended.
Public - a year ago
reviewed a year ago
1 review