Should I have multiple container or single container?
In this post, I am talking about advantage and disadvantage of having multiple containers. For the small companies, there is not much issue because they can work with single container easily, however big or multinational companies always face this challenge.
GOOGLE TAG MANAGER STRUCTURE
Most of the time organization have a single account and have multiple containers within the same account for different website or app. Then within each of these containers, they will organize tags by using consistent naming strategies and GTM’s built-in features (folders, rules that trigger tags for certain URL structures, etc).
Google gives more detail about tag organization here: //support.google.com/tagmanager/answer/6261285
How many accounts and containers do I need?
In most cases, you need one account and one container for each domain/websites or app.
SINGLE CONTAINER – ADVANTAGES
1) Ease of sharing: Configuration (tags, triggers, custom JS, etc) can’t be easily shared across containers. For example, a marketing tag may contain some custom JS that returns a URL without any query strings. As long as everyone is using the same container this can now be used by everyone for any marketing or analytics tags they need.
2) Ease of troubleshooting: For example, the basic GA page view tag should be on every page of a domain or it won’t work correctly. It’s easier to ensure that the GTM container is firing on every page than to both checks that a GTM container is on every page and then also check inside it to make sure that the GA tag is configured correctly.
3) Naming consistency: Use names consistently and don’t name an event, say, “Logged in” in one place and “Login” in another. Regardless of how you split up configuration, in the end, everything sends data to the same marketing and GA accounts, so it’s important to think about how it all fits together. You could send all your data to its own GA property but then you’re adding in a lot of complexity when you want to combine it together again (it’s a lot easier to split it out than to combine).
4) Conflict prevention: In GTM, custom dimensions for Google Analytics are set in the page view and event tags using an index number that matches to the corresponding index in the Admin section of Google Analytics, like this:
If you’re setting up multiple page view tags you risk having one part of the company set index #1 to (for example) user ID, while another part of the company sets index #1 to page type, which may then cause a conflict in GA (in many cases the final value at the end of a session will overwrite the earlier values). If everyone uses the same page view tags, they can see clearly that index #1 is already taken.
5) Cross-site tagging: Companies often have cross-site tags like remarketing tags, footer tags, etc., which don’t fit neatly into a single silo.
6) Ease of updating: If you want to make changes to how a tag is configured (an ID, a linked domain, etc), you only need to change it in one place.
7) Organization: As you continue to get marketing/analytics tag requests, you will probably find you need some regulations around who is allowed to configure, what they can configure (e.g. custom HTML tags are riskier than built-in template tags), testing procedures, and so on. Because of this, the typical setup is that tag management is funneled through an individual or small team. If your company follows this setup in the future, it will be easier to manage if all the tags are in one place rather than split up into multiple containers.
SINGLE CONTAINER – DISADVANTAGES
1) Publishing a container will publish changes for all parts of the website. If you need to make changes to some parts of the website and not others, you will need to use triggers and workspaces carefully.
2) If you have lots of tags for all parts of the website in one place, it can look cluttered and you have to rely more on folders and a logical naming strategy. One good strategy is serviceName – tagType – Detail, e.g. GA – Event – Header Click.
3) Permissions. Currently, permissions (read, publish, etc) are set based on the container– you can’t set it so someone can only publish tags for certain URLs but not others.
Overall the disadvantages are relatively minor and manageable, so in most cases, I recommend maintaining a single GTM container. The primary exception would be if the site is divided in such a way that most tags are not shared, and the output doesn’t get sent to the same GA properties or marketing accounts.
Finally, in the case that you do find yourself needing to implement multiple containers on a page, Lunametrics has a great post discussing the right way to do it: //www.lunametrics.com/blog/2017/04/04/pitfalls-avoid-multiple-google-tag-manager-containers/.