
March 29, 2025
Google Tag Manager and Multiple Domains: How to Configure?
Updated: March 29th, 2025
So, you have probably landed on this article because you are working with multiple domains (e.g., domain1.com and domain2.com) and have some doubts on how to handle Google Tag Manager. Should you use one GTM container on all domains? Or should you use one container per domain?
In this guide, I’ll show you how to handle Google Tag Manager on multiple domains. These tips apply to subdomains too.

Video tutorial
If you prefer video content, here’s a tutorial on my YouTube channel.
Google Tag Manager does not care about domains or subdomains
As the subtitle of this chapter has already spoiled, the GTM container does not care about how many domains you use it on. If you want, you can use the same container on five related websites (that are hosted on different domains or subdomains). Even though (most likely) this will cause you some headaches, there are no technical limitations.
When it comes to managing Google Tag Manager on multiple domains, the main thing you should be thinking about is management. Will it be convenient to manage tags, triggers, and variables of 5 different websites in a single container?
Think about this. You have a tag that you want to fire on all pages of the domain1.com (but not on the domain2.com). Reminder: you are using the same GTM container on both domains.
In this case, the All Pages trigger will not work because it will fire on BOTH domains. But you need to fire it only on one. What do you do? You need to create a Pageview trigger that fires only on domain1.com.
As time goes by, you will notice that the number of assets in your GTM container grows exponentially: a lot of tags, triggers, and variables that are related only to one domain. But since you are working on multiple domains at the same time, the number of assets is 2x, 3x (or more) than it should be.
Eventually, the container might even exceed its maximum size, and you will be forced to either get rid of some items or migrate to separate containers.
Also, larger container = more resources to download for your browser. This affects page performance as well.
It is recommended to use one GTM container per domain
Having the previous example in mind, always think about how different those websites (on different domains or subdomains are). How likely are you going to need a tag, trigger, or variable that is needed only on domain1.com but not on domain2.com.
If the answer is “very likely”, then you need to use separate GTM containers per domain/subdomain.
By using separate GTM containers, you’ll notice a smoother tag management process. There will be fewer tags/triggers/variables, and 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 assets).
Even if you are operating on the same domain but have separate subdomains, for example, blog.mydomain.com, support.mydomain.com, and www.mydomain.com, you (probably) should use separate GTM containers.
Why? Because those subdomains serve different purposes, their structure is different and, most likely, you will be measuring different things.
- on blog.mydomain.com, you will probably be tracking content consumption, email opt-ins, how visitors engage with your content (blog posts), etc.
- on support.mydomain.com, you will be tracking how visitors engage with your help articles, how they create or close tickets.
- on www.mydomain.com, you will be tracking how visitors sign up for your product (or maybe purchase your products), how they engage with your landing pages, etc.
Most likely, all those websites will have different elements, classes, and ids. Therefore, your triggers will be very much subdomain-specific. And in that case, one container per subdomain makes tag management easier.

Sometimes it makes sense to use one GTM container on multiple domains
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, same interactions are being measured, 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 (oh no!), export a part of the container with gtmtools.com, or use the 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,e but the scale of such “unique” tracking implementations will probably be pretty low.
Hard to imagine similar websites on different subdomains or domains? Here’s an example: a business with localized versions, for example:
- country1.mybusiness.com
- country2.mybusiness.com
- country3.mybusiness.com
or a more common scenario – completely different domains.
- mybusiness.com
- mybusiness.co.uk
- mybusiness.de, etc.
All websites have almost identical structures and code. The main difference is translations.
In this situation, you should ask yourself and other people involved in the tracking/analytics + your boss: are you going to track the same things on all domains/subdomains of different locations or not? If the answer is yes or very likely, then it makes sense to use the same container for all the domains/domains of similar websites.
If the answer is not sure, not likely, or just a plain no, then create a separate Google Tag Manager container for each domain/subdomains.
What about things like Google Analytics?
The way you structure your tracking tools, like Google Analytics or Facebook Pixel, does not matter to Google Tag Manager. The number of GTM containers has absolutely no relationship to the number of GA properties or Facebook Pixel accounts you use.
If you want to track visitors across different subdomains or domains of your business, then you will need to use the same GA property. But that does not mean that you need to use the same GTM container. Every website can use a different Google Tag Manager container, but send the data to the same GA property. This applies to any other tool that you have installed via GTM.
Google Tag Manager and Multiple Domains: Final words
When it comes to deciding the number of containers, I always think of the structure of websites and what kind of things I am going to measure.
Are your websites (hosted on different domains/subdomains) very similar (in terms of content, structure, etc.)? Or are they quite different?
- If you have, say, three websites that are very similar and 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. But you should definitely discuss that with your colleagues, boss, or someone else who is involved. Ask if you will be tracking similar or different things on those domains. The more differences there are, the higher the chance of separate GTM containers.
- If you have three websites that are different in terms of their content, structure, and 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.

16 COMMENTS
Interesting points, Julius. I would add one more case when using one container across multiple domains is recommended, based on personal experience. That is when governance over a large number of sites is limited, but they are all part of a same organisation. Then, having one container for all simplifies communication with devs and management on the websites. If you have GTM 360 you can then work with zones for specific cases
Zones might help here. But if you are not using 360, then one container for all (different) websites sounds like a tag management nightmare. Too many exceptions, too many tags that are needed just for a single website. The container size limit (200kb) will be reached much faster.
Hi, Julius. Good article. What would you say about using one GTM container across a domain and subdomain, where the subdomain is simply used for the cart and check out pages, every other page, including product pages, is on the main domain? I feel like one GTM container would make it easier to track events and conversions, rather than creating a separate container for the subdomain.
Without knowing full context, using one container can be a good idea
Hi Julius, just letting you know that the hyperlink to stackbug.com about GTM limits is no longer working. You could just link to your own post about this topic :).
Thanks! Done
Hi Julius, what is the best set up if you have an ecommerce subdomain which is book.example.co.uk. All traffic will be directing to www.example.co.uk but once the customer has selected an item to purchase they will be sent to the book example.
I don't know full context about this website so I cannot give you a definitive answer.
Hi,
My company currently has two domains on each of which we'd like to track different things so it's advised to have separate containers. However, to direct to one domain quote.tg.com, users always have to go through the other domain tg.com, they can't just go to quote.tg.com directly.
My GTM debugger for the quote.tg.com just doesn't work at all. Any thoughts?
Thank you!
You have to enable the preview mode for both domains separately. Then it should work.
Hi, we have created separate containers for each subdomain in Google Tag Manager. When I attempted to upgrade to GA4 using your video tutorial, I only saw the main website data flow in. Should I paste the measurement ID in all the sub-domain containers?
Please help here.
Yes, all containers of the subdomains should use the same measurement id
Thanks for the detailed post Julius!
I'm faced with a similar situation where I have homepage on the main domain (www.domain) and the crm on (order.domain). My concern is how I'm going to be able to track traffic that flowing through the the sites. EG. Google Ads > Homepage (www.domain) > CRM (order.domain). With separate containers configured for these separate domains, is Google Analytics going to automatically capture the flow or do I need to manually set some things up? If yes to the latter, do you have a guide you could point me to? Thank you!
Hi Julius,
What I implemented was to have different GTM and GA4 for my different domains (example.no & example.io) because there are different things to track for the domains. But my problem now is that the visitors from my .io domain is getting sent to both .io and .no domain and vice versa. Does this have anything to do with how we implemented into the site? (via wordpress HFCM)
Hi Julius,
We have a client with a main website and a new subdomain about to be launched. The client is concerned that the current GTM container will affect site speed on the new subdomain.
I recommended a new container for the subdomain but the client is concerned about doubling up on work having to update 2 containers in future.
Someone has suggested the following:
Create a new container for "master GA4 tracking" and consolidate tracking there for all GA4 tags
Load that container via GTM into the main site container
Load that container directly on that site for the new subdomain.
I remember reading not to load GTM via GTM but can't seem to find any information online.
Do you have any advice?
Hi Julius,
I have a wordpress website hosted as domain.com
and two subdomains app.domain.com and login.domain.com
Subdomains are single page applications
Currently am using on container for all there websites.
Should i create separate containers for each of these?