With the Matomo Tag Manager it is possible to export a copy of an existing container and import this into another website. Follow the steps below to easily transfer your container configurations between sites:

Before following these steps, it is important to note the imported container will overwrite any existing tags, triggers, and variables in the destination container.

Exporting a Container

1 Navigate to Tag Manager in your Matomo dashboard from the top menu.

2 If you have multiple containers, select the container ID you wish to manage from the drop-down menu.

3 Select « Versions » from the left menu.

4 At the bottom of the page click the « Export Draft » button to save a copy of your existing container.

(Alternatively you can export a copy of a particular version of your container by clicking the « Export Version » icon.)
Exportversion-icon

5 A .json file containing the container configuration will automatically be downloaded to your device.

Importing a Container

1 Navigate to Tag Manager in your Matomo dashboard from the top menu.

2 If you have multiple containers, select the container ID you wish to manage from the drop-down menu.

3 Select « Versions » from the sidebar menu.

4 At the bottom of the page Click the « Import » button.
matomo-import-button

5 Open the previously downloaded .json file on your computer with a standard text editor such as Notepad. You will need to copy the text within this file and paste the contents into the appropriate field marked in the screenshot below.
tag manager import

6 Confirm the import by selecting the « Overwrite current draft with this version » button. This will restore the contents of your container into the new site.

7 Once the container has been imported, the last step is to edit the Matomo Configuration variable from the Variables section located in the left menu. The reason for this change is the previous siteID has been carried across with the exported container. (If you have a custom configuration variable in place, the Matomo Configuration variable maybe named something else.) When editing the variable, you will need to change the Matomo idSite to the ID used by your new container/website.
Matomo-idsite

If you are unsure what siteID your website is using, you can confirm this from the Administration > Websites/Measurables > Manage section of your Matomo dashboard. Once the idSite has been adjusted, the steps to export/import the container will be finished.

Tip: Creating a Template Container for Efficient Website Setup

In addition to the steps outlined in this FAQ, consider implementing a Template Website and Template Container strategy to streamline the process of setting up multiple websites with similar containers. Here’s how that could work:

  • Create a Template Website and Container: Designate one of your existing websites as the Template Website and configure its container settings to represent the ideal default setup.
  • Export Template Container Settings: Once your template container is configured, export its settings using the above FAQ for future use. This will capture the container’s configuration, allowing you to replicate it across multiple websites.
  • Import Template Settings for New Websites: When creating a new website within Matomo, import the previously exported template container settings. This will automatically apply the predefined configuration to the new website, saving you time and effort.

By utilizing a template container, you can ensure consistency across your websites while minimizing manual setup efforts. This small tip can significantly enhance your workflow, especially when dealing with multiple websites with similar structures.

Previous FAQ: How do I can configure the available environments?