Skip to main content

I’ve worked on many Google Tag Manager (GTM) projects and I wanted to share tracking and measurement and best practices built around GTM containers for the wider digital marketing and analytics community via GitHub. One of the reasons I created these specific containers is to help other marketers manage their tracking and measurement across multi platforms with consistency and a best practice approach that’s easy to implement. I’ve witnessed too many occasions where tag management has been overlooked and its integral role in tracking the success of measuring campaign performance means that we need to prevent it from being an afterthought in the set-up process!

Tag managers are powerful and a vital clog in the martech ecosystem. It’s the cornerstone for a brand’s data and measurement strategy. The brands that are not utilising a tag manager are falling behind, and the ones who are must ensure that it plays a key role in the strategy.

I hope that by sharing my best practice containers, with the wider marketing and analytics community will have an open resource to solve the most common multi-platform tracking and measurement concerns today.

Overview of the containers

The containers have been built mainly around Google Analytics with the focus being on Google Analytics 4, there are still containers for Google Analytics 3 and the ability to dual track. The containers also include Facebook, Google Adwords, Bing, and LinkedIn. Across all the containers there is a consistency in the set-up of tags, triggers, and variables.

In total there are a total of 29 different containers covering a range of potential scenarios:

  • Staging containers for GA3 + GA4
  • Enhanced E-commerce for GA3 + GA4
  • Collecting UTM parameters for GA3 + GA4
  • Facebook, Google Adwords, Bing E-commerce tracking
  • Single Page Application (SPA) for GA4
  • Error page tracking for GA3 + GA4
  • Virtual pageview for e-commerce checkout funnel for GA3 + GA4
  • Mapping country and language codes using vlookup tables (based on base practices around Hreflang) for GA3 and GA4
  • No Index for SEO
  • Tracking Site Speed
  • Enhanced E-commerce for GA4 using Segment

* The Google Analytics 4 E-commerce / Enhanced E-commerce containers it is currently based of the Universal Analytics (GA3) data layer and data model not the GA4 data layer and data model will hopefully be able to provide an updated GA4 E-commerce container soon.

How do I find and apply the right containers to my GTM account?

For the different GTM containers I have placed the json containers within GitHub, which can be found here: https://github.com/mrdipeshashah

7 steps to get started:

  1. Download the relevant json container from GitHub
  2. Upload the json to your GTM container
  3. Go to variables and update the platform ID’s – Google Analytics, Facebook, Google Adwords etc
  4. Check the datalayer variables set-up in GTM against what you have set-up in your datalayer
  5. Check that the triggers set-up in GTM match against what you have set-up in your datalayer
  6. Have a thorough test that tags are firing as they should be and data is collected i.e., in Google Analytics
  7. Hit publish

Best Google Tag Manager testing tools

With Google Tag Manager there is a lot of testing and validation that needs to be done. These are some of the main chrome tools that I use: