Google Tag Manager provides a way to put snippets of code on a website and mobile apps, without involving a website developer to change the underlying codebase.

If your website or app is a piece of printed paper, tag managers are similar to putting sticky notes on top of that printed paper. Sticky notes are much easier to add and remove, bringing in flexibility and speed over reprinting the original page.

Because of speed and flexibility, tag managers are very useful for marketing teams. They can add a new analytics tool, pop-up software, email capture tool etc within minutes, unlike developer workaround times that can take days or weeks.

We assume, because you’re here, you know what Google Tag Manager is – but are a little uncertain if you’ve set it up right. True, modern web stacks are increasingly complicated by different frameworks and libraries full of nuance – and tag management solutions like GTM can interact with these in unforeseen ways. Without in-house expertise, mistakes can be made where things do not work as expected. Here it makes sense to get a consultant in, rather than learn the nuances in-house.‍
Usually there’s a context for wanting a google tag manager consultant or audit. The reasons can be myriad. But at an abstract level the usual queries or requests are:

  • I’m a beginner at GTM and want some guidance;
  • My tags are not firing as expected;
  • Custom or javascript values are not appearing in outside tools, eg GA4 or Amplitude;
  • I want server-side implementation and need help;
  • Google Tag Manager is not working as expected on my single page app (eg angular / react);
  • I want to understand best practices;
  • I don’t quite get this data layer thing;
  • I don’t quite get whether I should be using GTM or something else;

I’m a beginner at GTM and want some help in implementation

The reason GTM has become popular is mostly because of the popularity of marketing-tech (martech) tools, which can now be installed by copying and pasting little snippets of javascript code onto websites. These are things like Google Analytics 4, FullStory, HotJar, Adobe Analytics, Amplitude, AB Tasty, LogRocket, InspectLet, etc. They let teams across marketing, growth and product understand whether their efforts are going anywhere – from marketing campaigns to new product features.

If a marketing team decides to try out a new tool, asking the developer team (often mediated by a product team) might introduce a delay of weeks while this ‘non priority’ issue fits into a busy developer’s backlog. In the real world most marketing teams want to trial and decide on this new product now, not in two weeks – by which time momentum may have died out. GTM and other tag solutions are ideal in this situation. Non software people can add these tools to the site without bothering the developers. Or so in theory.

Due to the complexity of web apps, installing a new tool could (in principle) break a site. Once I tried installing LogRocket onto a staging site, which broke the site, because of an uncaught error – good thing it wasn’t the live site. No-one wants to be the person responsible in the marketing team for that.

Quickly How Tag Manager works

Tag Manager works on the basis of ‘triggers’ and ‘tags’. 

Triggers describe ‘when’ you want something to happen. E.g. when someone loads a webpage, clicks a button, after X seconds.


Tags are that ‘something’ – the verb – you want to happen. E.g. A tag can be the Google Analytics 4 universal tracking code. Tags usually consist of firing a piece of javascript code, even if that javascript code in turn triggers a complicated backend process over with some third party.

The nifty thing about these tag management tools is that once the trigger is set up, you can make multiple ‘events’ or ‘verbs’ happen simultaneously. For example, on loading a given page, we can let Google Analytics, Amplitude, FullStory, Facebook’s audience graph and a custom API endpoint all know together. In a way it is similar (but not the same as) some ‘customer data platforms’ such as Segment.com. But Segment’s CDP is more powerful. 

If you want a guiding hand with installing GTM, set up a free call with us.

My tags are not firing as expected

There are many reasons why this can happen. Usually it is best to debug the container where possible by running it in preview mode. 

Above you can inspect how each tag’s triggers are or are not met, as above (both ticks mean the event’s triggers were satisfied, and so the tag fired).

Perhaps the most common reason a specific tag does not trigger is because the trigger conditions, while looking like its conditions have been met, are not satisfied at the right moment in time. Say you’re firing a custom event – ‘Search’ – but this fires before GTM has been loaded on the page. Here GTM’s triggers won’t pick up on it. As GTM is designed to be ‘asynchronously loaded’ (which means ‘we’ll get around to it but we don’t want to slow down the page otherwise loading in the mean-time’) this happens often enough.

As an another example: say you want to build a trigger to run on ‘Page Load’ where a variable – let’s call it userID  ends with the number 1. If the userID variable isn’t accessible at the point of page load the trigger will not fire.

Values are not appearing in outside tools, eg GA4 or Amplitude

Again the debugger can help to see if GTM has ingested the variable or value correctly. Often the reason lies in a misconfiguration in GTM resulting in the value not being absorbed, rather than the third party tool not indigesting that value. If you are using custom variables, check you have picked the right type (is it a datalayer variable, a JS variable, a localStorage key/value pair, or something else?) In other cases the third party tool (eg Google Analytics 4) needs to be set up explicitly to ingest customs values  / custom parameter. 

I want server-side GTM implementation and need walking through it

This is more a mid-size or enterprise requirement and will realistically be a group project to implement across product, marketing and the development team. Server-side GTM instances are useful for many reasons – once is to capture more accurate data capture. Contact us to discuss this.

Google Tag Manager is not working as expected on my single page app (eg Angular / React)

The debugger is your friend; often in single page apps (SPAs) the entire page is not reloaded when navigating between ‘views’ or sections, and so the standard 'Page View' and ‘DOM Ready’ triggers do not work.

The equivalent of the 'Page Load' trigger for SPAs should be the 'History Change' trigger, but this is temperamental. Thus for accurate tracking between ‘views’, a ‘Custom Event' trigger should be used. This requires your developer to fire a small JS snippet on each view change, which in turn will be absorbed by GTM. In a way this undoes one of the main motivations for using GTM (to bypass developers) but GTM still brings advantages in other respects, like controlling what tags are fired, even if the trigger setup needs some developer help.

I want to understand best practices

Obvious ones are having a staging container that is different to your production container. That is, when testing new tags, do it on a different (staging) website and a different container environment, so if your tag happens to break your website, it only affects a handful of employees.

Another practice is sensibly naming tags with an agreed and documented schema, so the container’s setup can be easily ‘read’ by anyone who needs to look into it. Similar to writing clean code.

One thing that is not always grasped by marketers is the difference between an event and a property or subparameter of that event. E.g. ‘Page Viewed’ with the custom attribute ‘url’ is far more logical and scalable than a separate ‘Viewed Home Page’, ‘Viewed Product Page’, ‘Viewed Contact Page’ series of events. 

There’s more to say depending on if you’re an app or an e-commerce business or an SEO play etc… contact us to discuss this.

I don’t quite get this data layer thing. What is the data layer in GTM?

In a way it may not matter, if you’re a marketer. To a web developer it looks like an array of objects that you can push values and objects to, because… it is just that! But to marketers, you can imagine it as an invisible ‘layer’ or ‘box’ on the webpage that stores all sorts of information about what's happening on the page. 

In that box you can put events, such as ‘Viewed Page’, userIDs, the product a user is looking at, cookies, the percentage of the page the user has scrolled down, the % of video watched - a custom event from the app – and so on. The data stays in the data layer until the user refreshes the page, at which point it is destroyed and started afresh. Google Tag Manager can access this information in the data layer to do things like send that data to Google Analytics.

The data layer is set up in the GTM setup code automatically in the part in bold below.

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.c...'+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','XXX');</script>
<!-- End Google Tag Manager -->

This part of the code checks if a data layer (denoted by w[l], where l is 'dataLayer') already exists. If it doesn't, it initializes an empty array []. This array is what becomes the data layer. Arrays or arrays of objects or ‘data layers’ (a fancy term for the latter) are not proprietary to Google. They’re a basic building block of most programming languages. 

In more developer-y language however, the data layer also acts like an event queue. Events are pushed onto this queue and then processed. This processing is not immediate and depends on how GTM's listeners are set up. This might lead to unexpected behavior, especially for those new to GTM who might expect instanteous processing.

I don’t quite get whether I should be using GTM or something else

This depends on your project or business’ needs. As discussed above it is usually used by marketers to install tags to help them with analytics or tracking of some sort. Because these things are fired on the front-end (the client), if they are “100% essential to get right” then perhaps loading them via tag manager is not the best option – for someone’s device, computer, tablet – whatever it is – may have many reasons for refusing to fire the tag. Adblockers and privacy tools are one of these. Another cause of unreliability is slow internet connections.

There are other tag management tools out there, such as Tealium and Adobe’s Experience Platform. Generally, most people go with Google’s Tag Manager unless there is a reason to deviate from it (e.g. because you’re working with Adobe’s Analytics stack instead).

Some teams without a technical background may occasionally misunderstand the need for tag management, assuming it is needed where actually it isn’t necessary.

Picking a Google Tag Manager Consultant

It helps to pick someone who is familiar with the sector, website size and analytics stack by speaking to them on a 20 minute call. See if you work together well.

Having a consultant with familiarity in javascript and website technologies is definitely useful. Why? Say part of the task is to debug why GTM isn’t sending user-IDs through to GA4. This may require an understanding of how certain web stacks are built – eg the userID may only be set as a globally accessible variable after GTM has been deployed and has already fired the ‘Page Loaded’ event – someone unfamiliar with web development may not understand this nuance. The same goes for some triggers that look intuitive (e.g. page load) but are not applicable in some contexts (e.g. React/Vue/Angular/SPAs). 

The more specific your requirements the narrower the pool of assistants to pick will be. If you’re an enterprise requiring assistance with server-side GTM installation, the skillset to do this is rarer than more ‘run of the mill’ installations.