Thursday, July 18

Google Tag Manager and Multiple Domains: How to Configure?

So, you have probably landed on this article because you are working with multiple domains (e.g. and 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.


Google Tag Manager does not care about domains or subdomains

As the subtitle of this chapter has already spoiled, GTM container does not care about how many domains you use it on. If you want, you can use the same container on 5 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, 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 (but not on the Reminder: you are using the same GTM container on both domains.

In this case, 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

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 but not on

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 the 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 assets).

Even if you are operating on the same domain but have separate subdomains, for example,,,, 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, you will probably be tracking content consumption, email opt-ins, how visitors engage with your content (blog posts), etc.
  • on, you will be tracking how visitors engage with your help articles, how they create or close tickets.
  • on, 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, ids, therefore, your triggers will be very much subdomain-specific. And in that case, one container per one subdomain makes the 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 measuredetc.):

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.

Hard to imagine similar websites on different subdomains or domains? Here’s an example: a business with localized versions, for example:


or a more common scenario – completely different domains.

  •, etc.

All websites are almost identical structure-wise, code-wise. 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 am I going to measure.

Are your websites (that are hosted on different domains/subdomains) websites 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 will be, the higher chance of separate GTM containers.
  • 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.

Source: analyticsmania

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x