August 9, 2021
How many Google Tag Manager containers do you need?
Updated: August 9th, 2021
This time the guide will be indeed shorter than usual. First of all, this blog post will not talk about multiple GTM containers on the same page. I’m answering a bit different question.
Say, you have 3 websites. How many GTM containers do you need here? One? Two? Three?
The reality is that there is no universal answer. One container might work, two or three containers might do the job as well. The real answer is: it depends.
If you prefer video content, take a look at this tutorial from my Youtube channel.
Think about the websites first
When it comes to deciding the number of containers, I always think of the structure of websites.
Are those 3 (or insert any other numbers) websites very similar (regarding content, structure, etc.)? Or are they quite different?
- If you have three websites that are very similar and, say, the main difference is localization (language), then I’d recommend using the same GTM container on all three websites. Because, most likely, you’ll be tracking the same things on all websites.
- If you have three websites that are totally different in terms of their content, structure, functionality, e.g. an online store, a blog, and a support page, I’d recommend using separate containers for each website because (probably) each one of them will have pretty unique tags, triggers, and variables.
Several different websites
By using the same GTM container on several different websites, your trigger conditions will contain more rules, more exceptions. It will be more cumbersome to ensure that a particular tag fires only on one website (e.g. only in your online store) and not the others. Your list of tags, triggers, and variables will grow faster and soon will become more complex to manage.
Eventually, the container might even exceed its maximum size of 200kb and you will be forced to either get rid of some items or migrate to separate containers.
By using separate GTM containers, you’ll notice a smoother tag management process. There will be fewer tags/triggers/variables, triggers will be less complex (with fewer conditions and exceptions). It will be easier for you to find particular container elements (rather than browse hundreds of entities).
If there are more differences than common things between tracking implementations of each website, you should go with separate containers for each site.
Several similar websites
On the other hand, I don’t always recommend having separate GTM containers. What if the websites are pretty similar? Here’s what the process looks like if each website has its own GTM container (even though they all are being tracked with the same Google Analytics Property, same Facebook Pixel, etc.):
- You configure particular changes in container A.
- Then you need to copy the same changes to containers B and C. You can try to do that manually (big nope), export a part of the container or use the tools like gtmtools.com or GTM Copy/Paste extension.
- And this will happen every time you implement a change. Far from an efficient and agile work process!
But if you had one GTM container across all three websites, one single change would be applied to all three websites instantly.
Of course, sometimes you will want to fire a tag only on one website but the scale of such “unique” tracking implementations will probably be pretty low.
To sum up, every time you face the situation with several websites and you need to decide how many GTM containers are needed, think of how different/similar those websites are.
What kind of tracking are you planning to implement on those sites? Will tags/triggers/variables be quite similar on all three websites? Or, contrary, quite unique for each one of them?
- If those websites are quite different in structure/functionality and you plan to track different things on each one of them (e.g. e-commerce tracking is planned only for website A), then you should go with a separate GTM container for each site.
- On the other hand, if those websites are quite similar and you plan to track the same things across all of them, it will be easier to utilize a single container (because all the changes will be immediately applied everywhere).
Julius, I wish there is a social icon button to like your article :)
Was amid deep research and planning an implementation for a client on this. This helped!
1. One GTM container for the main website with clean tag, etc structure
2. Another GTM container for all other websites of the client (because they are just created basically for single project showcasing and for SEO)
Glad to help!
Let me add a pro for separate GMT containers: they make it easier to transition your client to another agency/freelancer when you are fired ;-)
A single container will also result in an easy transition. The main thing here is that the client must have full admin access to all of his/her GTM accounts and containers :)
Let's say I would not recommend keeping more than one client on the same container :-)
Oh, definitely not. Every client MUST have separate containers.
Thank you! This simple guide helped me to not panic and work out the best approach!
We have a mother company website and from there we redirect to the product pages (each product page has a different domain). Users will get to each page through the mother company one so my goal is to track when users get to from page A to page B (let's say). In this case, should I get different containers? Thanks!
If those website are very different, then use different containers.
Kind of a different but parallel problem... Our client is changing their URL as a result of a rebrand, but the site's structure and content will remain largely the same. Would you recommend keeping the OLD site's container but change the primary URL, or should we create a new container for the new URL?
Most likely, the new website is totally different, therefore, I'd recommend a new container.
If using 2 containers, at the time of adding the snippets to the page, the beginning code of the second container follows the end of the first in both, the head and the body parts?
Hi, it is not recommended to have multiple GTM containers as they will/might conflict in the datalayer (unless they are configured to use different data layers).
To answer your question - does not matter :)
We have a subdomain on a third party (virtual events) platform and we want to track activities on there. Is it practical to create a separate GTM container for that property? How do we do it?
Thanks so much for all your articles!
So as an affiliate marketer let's say I have 3-4 separate offers (sites/funnels) for one/each company I promote, I am assuming that it makes sense to have a separate container for each and every site/funnel and offer even if it's the same company?? even though I am recording/tracking the same things (opt-ins and sales) on each site/funnel? I assume this will be easier to track later with which funnel/site is doing what (better/worse)? and every new offer in the future gets a new container inside the same account?
Now lets say I decide to make ads/content for another person or business outside of my personal affiliate offers, it then makes sense to make an entirely new account for every other/new person/business? and then make new containers for each of their sites/offers like I do with my affiliate sites/offers?
Am I understanding this correctly?? I appreciate your feedback a ton!
Great article, Julius.
How will subdomain and crossdomain tracking work when using multiple containers with the same GA property?
Separate containers make no difference here
Thanks for replying so quick.
What about configurations for cross domian tracking in the different GTM containers. Will all GA tags have the same setup, e.g. same domains in the auto link domain list, etc..? Cant find any information on how the ga_ cookie behaves if you use multiple gtm containers but they all use the same GA property...
As I have said, different GTM containers have no impact. _ga cookie does not behave differently either. You can have the same cross-domain setup in both containers and that will work just fine.
Can I use one GTM container for both mobile app and web?
What's the best way?
If the answer is yes, Do you have any document and video about adding event tags for mobile app in GTM?
After adding event tag in GTM, Does data go to the firebase or GA4?
No, you need separate containers. Web container will not work on mobile app.
Thanks a lot
Is there any way to create a Button click tag in GTM for mobile app or creating in firebase the only way?
If developer add some data to the data layer for mobile app, Can I track those by creating variables and then adding tag?
In GTM "mobile app" Is there any way to see the preview debug mode and fired tags and data layer?
Hi Julius, it's very informative content that I found. But I have few questions. How many accounts you can create in google tag manager? and also how many containers can create in a single account?
400 accounts per user. 500 containers in a single account.
Hi Julius. I found your info very informative for setting up Google Tag Manager. My question is I have a website that I'm setting up with Google Tag Manager, for example www.iamsmokeysmothers.com, off that website I have specific pages say www.iamsmokeysmothers.com/subscribe do I set up a separate container for subscribe?
Still looks like a part of the same website for me. I would use the same container.
Hi Julius, I found your video very helpful rather than the article. But now I am a bit confusing should I use a separate container for a woo-commerce website blog post or go with the same one.
Let's say I have web application that consists of 3 separate parts, they are different in their functionality, one is website builder, the second one is kind of dashboard and the third one is something like a blog and each of those parts has it's own index.html file.
So in case If I use 1 container I need to put the same tag manager script in all those three parts separately. I guess if I use 1 container in 3 places it will mean that I have to do some configurations in tag manager consul to make sure that tags and triggers are working for the site part that is needed.
On the other hand client can freely navigate from one part of application to another and I want to be able to track that flow. For example to track the same user actions in both parts and be able to identify that it's the same user. So does having 3 different container IDs somehow makes this unachievable ?
Separate containers have no impact on tracking the same user and the same flow across websites. You need to think here only about one thing - will it be easier for you to manage one container or 3 containers? And I explain this in greater detail in this very blogpost
Hi :) Thank you for the content, it's very helpful :)
Do you have any information about adding two different container to the one website? Can it cause any problems?
Hello Julius I found the information to be very interesting. But I do have a few inquiries. How many accounts in Google Tag Manager can you create? What is the maximum number of containers that one account can create?
Your blog has been incredibly helpful to help get our GA4 and Tag Manager setup right.
On your naming convention article -
- you mention dev, staging & production as separate GA4 properties; is it possible to have one GTM container for all of them? Or would tag manager push an event that occurs in one property, to all of the properties.
You can have multiple GA4 properties in the same GTM container. But that needs additional configuration, e.g. with lookup tables.
So we have a website for promoting our services assume (Website.com) and a subdomain to it which act as web application (app.website.com) for through which users can book a service.
As far I got to know by reading this article is we should have two separate containers in this case.
But could you please suggest if configuration both the containers with Same GA4 would be a good option?
Yes, GA4 should be same in both containers
I wanted to share a specific use case where attaching multiple GTM containers to a page may be useful.
My client is using multiple GA properties and multiple GTM containers.
We have developed components to be reused among multiple websites. When a component in a page sends an event, a tag should be configured in the GTM container attached to that page. It means that all tags, triggers and variables should be reconfigured into this container in order to get the information into GA.
Since it's technically possible to register multiple GTM containers for a same page. A container for global shared components could then be created and attached to the pages which are using those components.
To avoid conflicts, the common container would use it's own data layer name. However I don't see what kind of conflict may happen at first thought.
What do you think about the concept?