A container in Matomo Tag Manager (MTM) holds tag manager components and acts as a workspace where you configure and manage your tracking. Matomo creates a default Tag Manager container with a pre-configured setup for each website, so you can start tracking with MTM right away.

You can create additional containers when you need to manage tracking separately, for example tracking multiple sites or site sections with different tracking requirements.

Each container has its own versions. You can work on changes in draft, test them in Preview/Debug mode, and publish a new version without modifying your website code each time.

Add a new container

  1. Log in to Matomo and open Tag Manager.
  2. Click on Manage Containers.
  3. All existing containers are shown for the selected website.
    manage containers in matomo tag manager
  4. Click Create New Container.
  5. Enter the Name and Description (optional) for your container. Use any name that helps you identify this container, for example, the name of the site or what you are using this container for.
    tag manager container settings
  6. (Optional) Enable the relevant settings if using Google Tag Manager:

    • Actively synchronise from the Google Tag Manager data layer (see FAQ).
    • Ignore Google Tag Manager data layer (see FAQ).
  7. (Optional) If using fire limits in tags and want to test tag execution, select the option, Enable tag fire limits to work in Preview mode. By default, fire limits are not applied in Preview mode.

  8. Click Create New Container to save the setup.

Once you have created a container, you will automatically be redirected to the container dashboard where you can start adding tags, triggers, and variables.

Container Context

In the Container settings, the Context field is set to Web and cannot be changed as Matomo Tag Manager currently supports only web-based tracking. Native mobile environments such as Android and iOS are not yet supported, so no alternative context is available.

Install the container on your website

To start tracking, install the container code on your website.

  1. You can find the container tracking code in two places:
    • Administration admin gear icon > Websites (or Measurables) > Tracking Code and select Tag Manager.
    • Or, open the Tag Manager container and click on Install code.
  2. Copy the container snippet and add it to your website’s code before the closing </head> tag.
    tag manager tracking code

lightbulb for tip
Avoid overloading your Matomo Tag Manager container with too many tags and triggers as it may lead to slower performance or issues on your site. If you need to manage a large number of tracking conditions, use the data layer to pass structured information and reduce complexity within the container.

Delete a container

Containers can be deleted from the Manage Containers page by clicking the delete icon next to the relevant container.

Note: This action is irreversible and will permanently remove the container and its components. Additionally, if a website is deleted, it will also delete any associated containers.