Skip to content
weballin

weballin DIGIWIKI

Container

The GTM container is the highest management unit that contains tags, triggers, and variables. When one snippet code (GTM-XXXXXX) is inserted into the site, all settings in the container are applied. There are web container (client side) and server container (server side) types, and it supports version management and rollback.

weballin

Containers belong under a GTM account, and you typically create one container per site or app. If you insert a container snippet (JavaScript code with an ID in the form GTM-XXXXXX) into the HTML head and body, GTM will run on the page.

GTM has a web container (client side) and a server container (server side). A web container is a standard GTM that runs in a browser, and a server container is a server-side tagging method that deploys to a cloud server and processes tags on the server instead of the browser. By combining the two containers, you can create a structure where data is sent from the browser to the server container and the server delivers it to each platform.

GTM screen path: You can see account → container list at tagmanager.google.com. In the container settings, manage the container ID (GTM-XXXXXX), workspace list, and tags, triggers, and variables. Containers can be backed up or transferred to another account using the export (JSON) function.

Key takeaways

  • Centrally manage and distribute multiple tags, triggers, and variables with a single container snippet.
  • It is divided into web container (client side) and server container (server side).
  • Version management is performed on a per-container basis, and previous versions can be restored immediately.
  • Workspaces allow multiple people to edit and merge at the same time.
  • You can export entire settings as a container JSON file to import or back up to another account.

References

Frequently asked questions

Can I install multiple GTM containers on one site?

Although technically possible, it is not recommended. If there are multiple containers, there is a risk of tag execution order conflict, data layer sharing issues, and duplicate event firing. Manage all tags in one container, and use the workspace function when collaboration is necessary.

Where should I insert the GTM container snippet?

The GTM official guide instructs you to insert the first snippet at the top within the head tag and the second snippet (noscript) just below the body tag. If inserted late into the head, GTM loading may be delayed and early pageview events may be missed.