How to take control of a messy tagging situation
Imagine a large organisation with a presence in multiple markets with a separate web domain for each. Each individual market has used their own Google Tag Manager container for their domain and some markets have even used additional Google Tag Manager containers to help tag subdomains. There has been a website migration in the past that warranted the creation of new Google Tag Manager containers. Some Google Tag Manager containers in the account have been created for test purposes and never got deleted.
On top of this, a similar thing has happened with the Google Analytics configuration. And it goes without saying that a clear and consistent naming convention hasn’t been applied in either Google Analytics or Google Tag Manager.
What you’re left with is multiple Google Tag Manager containers implemented across multiple domains sending data to multiple Google Analytics properties and one analytics team trying to make sense of what’s going on with data collection.
Walking into this type of situation is not an uncommon occurrence and this blog will cover a really useful tip to help take control of the situation.
We are looking to find out which domain each Google Tag Manager container is implemented on, as well as uncovering any Google Tag Manager containers that are not currently collecting data. To do this we are going to create a temporary Google Analytics property that will receive data from all Google Tag Manager containers that we have access to.
We will also configure a “GTM Container ID” Custom Dimension in this Google Analytics property that will receive the Container ID that sent the hit to Google Analytics. This will allow us to report on the exact Google Tag Manager container that sent a hit.
Within each GTM container, we will create a Google Analytics pageview tag that sends data to our newly created Google Analytics account.
In each tag configuration, we set Custom Dimension 1 as equal to the “Container ID” variable. Which can be found in Google Tag Manager as a built-in variable.
After publishing the Google Analytics tags, we are able to report on the data collected from each of the Google Tag Manager containers in our account. We can do this via a custom report with “Hostname” & “GTM Container ID” as dimensions and “Hits” or “Pageviews” as the metric.
Using this information, we can confidently delete any Google Tag Manager containers that have not sent any data to this property. We can also use the hostname information to create a clearer naming convention for our Google Tag Manager set-up. The hostname information can also be used to spot potential Google Tag Manager consolidation opportunities.
A Container ID custom dimension may not fix your tracking itself, but it can be a very informative custom dimension in Google Analytics and can help you clean up even the messiest of Google Tag Manager configurations. Once you know where each of your GTM containers are implemented, it makes it much easier to actually use Google Tag Manager for its intended purpose: quickly and easily updating marketing tags across your websites.