1.8K members online now
1.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
Guide Me

GTM implementation Opinion: sub-domains

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Looking for some opinions.


Here is the scenario: I have a main domain In this domain i have deployed GA/GTM with a single container GTM-ABCDEFG, that sends all tracking hits to a GA account UA-123456-1


I am now adding a sub-domain of which will be a slightly different code base, but will be tracked under GA account UA-123456-1, alongside the main domain.


Here is the question, do I create a SEPARATE GTM container for, or do I just deploy the main container (GTM-ABCDEFG) to


I am leaning toward using a different container for the subdomain:

PROs: clearly isolated tags / triggers for the different codebase, can maintain different container life-cycles as each of the sites undergoes deployment cycles.

CONs: more complexity, might get confused where the hits are coming from.


Curious to see what the community at large thinks.

1 Expert replyverified_user

GTM implementation Opinion: sub-domains

Top Contributor
# 2
Top Contributor

I think you might lose a big part of the flexibility by using 2 containers unless the use cases are totally different.


Are you planning to create a lot of sub domains in the future?

Do you need to think access control by sub domain?


With one main site and one sub domain you can easily use one container and avoid possible mix ups with clear naming of the tags,variables etc: 'Main | Sub | Common - Tag name' for example.



To make bad day worse, spend it wishing for the impossible

Antti Nylund, Google Analytics Top Contributor
Did my answer solve your issue? If yes, please mark it as the ‘Best Answer.’ Otherwise keep on asking.