Container export and import

Exported containers can be compared, modified, shared, stored in a version control system, and imported back into Google Tag Manager. This feature is commonly used in the following ways:

  • Make bulk changes to tag configurations. You can set up a new site with identical structure and tag configurations to an existing site. Details such as conversion IDs and domain names will be different. Instead of recreating the container from scratch, export a container from the existing site and use a text editor to find and replace the affected conversion IDs and domain names, and then import the revised configuration file into a new container.
  • Store all website configuration data in a central location. Store all your container versions in a version control system and review changes before publishing them live. Google Tag Manager maintains its own version history, but if your workflow makes use of text-based tools such as diff and Git for change management, you can use container export and import for this purpose.

Containers are exported as JSON text files. To replicate a container setup, export the container and then import the file into a different container. You have the option to modify an exported file to include only a subset of the source container's triggers, tags, and variables. By exporting and importing containers, you can create and re-use container templates and share Google Tag Manager implementations with others.

Export a container

  1. In Google Tag Manager, navigate to the desired container.
  2. In the top navigation, go to Admin and then Export Container.
  3. Select the desired container version from the selector.
  4. Preview and confirm your export file and click Download.
Note: You can also export containers from the Trash Can.

Import a container:

  1. In Google Tag Manager, navigate to the desired container.
  2. In the top navigation, go to Admin  Import Container.
  3. Select the desired container file using the selector.
  4. Select Overwrite or Merge.
    • Overwrite will remove all your existing tags, triggers and variables, and will replace them with those in the imported container. A new container version will be created before the import.
    • To Merge, select whether you want to overwrite or rename conflicting variables, triggers and tags.
      • Overwrite conflicting tags, triggers, and variables: If a variable, tag, or trigger in the new container has the same name but the contents are different, overwrite the old one with the new one. (If the contents are the same, there is no conflict.)
      • Rename conflicting tags, triggers, and variables: if a variable, tag, or trigger in the new container has the same name but the contents are different, rename the new one. (If the contents are the same, there is no conflict.)
  5. Click Continue. The preview dialog shows how many tags, triggers and variables will be added, modified, or deleted. Click View Detailed Changes to see a list of all the items that will be affected.
  6. Once you are satisfied with the changes that will be made, click Confirm.
Was this article helpful?
How can we improve it?