Export and import containers

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.

Import a container:

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.)

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.

Once you are satisfied with the changes that will be made, click Confirm.