Container export and import

Google Tag Manager containers can be exported as JSON. Exported containers can be compared, modified, shared, stored in a version control system, and imported back into Tag Manager.

Common uses for this feature include:

  • Bulk changes to tag configurations. You can set up a new site with identical structure and tag configurations to an existing site. Export a container from the existing site and use a text editor to modify items that need to change (e.g. conversion IDs, domain names,) and then import the revised configuration file into a new container.
  • Store website configuration data in a central location. Store all your container versions in a version control system and review changes before publishing them live. 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, use container export and import for this purpose.

Export a container

  1. In the top navigation, click Admin.
  2. In the Container section, click Export Container.
  3. Click Choose a version or workspace.
  4. Select the desired container or workspace version.
  5. Click Download.
You can also export a container from the Trash Can.

Import a container

  1. In the top navigation, click Admin.
  2. In the Container section, click Import Container.
  3. Click Choose container file and select the file that you would like to import.
  4. Select if you would like to add the imported file to a new or existing workspace.
    • To add the file to a new workspace:
      1. Under Choose workspace, click New.
      2. Enter a title and description for your workspace.
      3. Click Save.
    • To add the file to an existing workspace:
      1. Under Choose workspace, click Existing.
      2. Select the desired workspace.
  5. Select Overwrite or Merge.
    1. 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.
    2. 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.)
  6. 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.
  7. Once you are satisfied with the changes that will be made, click Confirm.
Was this article helpful?
How can we improve it?