Importing – Exporting Container files in Google Tag Manager

What is ‘Export Container’ feature in Google Tag Manager?

Through ‘Export Container’ feature you can export a container file to your GTM account.

A container file is a JSON file (a file with the extension .json).

This file can contain certain or all tags, triggers and variables you want to import.

When the container file contains certain number and type of tags, triggers and variables for a particular type of tracking then it is called Google Tag Manager recipe.

What is the advantage of using the Export container feature in GTM?

Through the export container feature, you can share your GTM configurations (aka tags, triggers and variables) with any third party.

What that means, if you want to share your GTM configurations for video tracking with a third party or another website, you can do that via GTM export container feature.

If you want to share the GTM configurations of your entire container with a third party or another website, you can do that via GTM export container feature.

If you want to share a particular container version or workspace, you can do that via GTM export container feature.

The GTM export container feature is basically equivalent to downloading a particular container version or workspace.

If you want to take backup of a particular container version or workspace then use the ‘export container’ feature.

How to export a workspace in Google Tag Manager?

Follow the steps below:

Step-1: Login to your GTM account and then click on the ‘Admin’ Tab:

Step-2: Click on ‘Export Container’ link under the ‘Container’ column:

Step-3: Click on ‘Choose a version or workspace’ button:

Step-4: Select the workspace, you want to export:

Step-5: Click on the ‘Export’ button. You should now see a dialog box which gives you the option to either open the exported workspace JSON file or save the file to your hard disk:

Note: The exported/downloaded GTM workspace file will have a name like the one below: GTM-MQ98JW_workspace32.json

Step-6: Select the ‘Save File’ option and then click on the ‘ok’ button. Once you do that, the exported JSON file will store on your computer hard disk.

Step-7: Click on the ‘Cancel’ button to close the ‘Export Container’ feature:

Get the E-book (72 Pages)

Get the E-Book (62 Pages)

How to export a container version in Google Tag Manager?

Follow the steps below:

Step-1: Login to your GTM account and then click on the ‘Admin’ Tab.

Step-2: Click on ‘Export Container’ link under the ‘Container’ column.

Step-3: Click on ‘Choose a version or workspace’ button.

Step-4: Select the container version, you want to export:

Step-5: Click on the ‘Export’ button. You should now see a dialog box which gives you the option to either open the exported container JSON file or save the file to your hard disk:

Note: The exported/downloaded GTM container file will have a name like the one below: GTM-MQ98JW_v51.json

Step-6: Select the ‘Save File’ option and then click on the ‘ok’ button. Once you do that, the exported JSON file will store on your computer hard disk.

Step-7: Click on the ‘Cancel’ button to close the ‘Export Container’ feature.

The Container File and where you can get one?

A container file is a JSON text file (a file with the extension .json).

This file can contain certain or all tags, triggers and variables you want to import.

There are two types of container files:

#1 Workspace container file – This file contains all the tags, triggers and variables used in a particular workspace. By default, GTM include the word ‘workspace’ in the filename of a workspace container file. For example: GTM-MQ98JW_workspace32.json

#2 Version Container file – This file contains all the tags, triggers and variables used in a particular container version. By default, GTM include the version number in the filename of a Version container file. For example: GTM-MQ98JW_v51.json

There are two ways through which you can get a container file to import:

#1 You export a workspace or a container version via the ‘export container’ feature.

#2 You used the exported container file shared with you by a third party.

What is ‘Import Container’ feature in Google Tag Manager?

Through ‘Import Container’ feature you can import a container file (workspace or version file) to your GTM account.

When the container file contains certain number and type of tags, triggers and variables for a particular type of tracking then it is called Google Tag Manager recipe.

What is the advantage of using the import container feature in GTM?

Through the import container feature, you can set up dozens of tags, triggers and variables in a container tag in one go.

This can come handy, when you need to set up same/similar tags, triggers and variables over and over again for multiple websites.

Without using the import container feature, you would have to manually set up each tag and its corresponding triggers and variables, and that too over and over again for each website.

Through the import container feature, you can share your GTM configurations (aka tags, triggers and variables) with any third party or website.

So if you want to share your GTM configurations for video tracking with a third party, you can do that via GTM Import container feature.

What you actually import through the import container feature is the container file (in JSON file format).

So you need to have a container file ready before you start your import.

Import Container Options

You can import a container file either to a new workspace or to an existing workspace:

When importing a container file, GTM give you the option to either merge the imported content with the selected workspace, or completely overwrite the workspace:

Overwrite Import Option

Overwriting the selected workspace will remove all your existing tags, triggers and variables in that workspace, and will replace them with the content of imported container file.

A new container version will be created before the import.

Use the ‘overwrite’ option only if you want to start fresh with the imported container.

Merge Import Option

Merging container files will allow you to keep your existing GTM configurations and just add in the new ones.

Before you merge the new container file with your existing container file, you would need to decide whether you want to:

# Overwrite conflicting tags, triggers and variables.

# Rename conflicting tags, triggers, and variables.

A conflicting tag is the tag which carry same name as the imported tag but its contents are different.

A conflicting trigger is the trigger which carry same name as the imported trigger but its contents are different.

Similarly, a conflicting variable is the variable which carry same name as the imported variable but its contents are different.

Note: A tag is not considered as conflicting tag, if it carries same name as the imported tag and its contents are also same to the contents of the imported tag. Same holds true for triggers and variables.

Select ‘Overwrite conflicting tags, triggers and variables‘ merge option, if you want to overwrite the conflicting tags, triggers and variables in the selected workspace with their corresponding imported tag, triggers and variables.

Select ‘Rename conflicting tags, triggers, and variables:’ merge option, if you want to rename the conflicting tags, triggers and variables in the new container version.

How to import a container in Google Tag Manager?

Follow the steps below:

Step-1: Login to your GTM account and then click on the ‘Admin’ Tab

Step-2: Click on ‘Import Container’ link under the ‘Container’ column:

Step-3: Click on ‘Choose Container File’ button to select the container file to import:

Step-4: Select new or existing workspace:

Click on ‘New’ button if your existing container is not empty. Otherwise click on the ‘Existing’ button:

If you click on the ‘New’ button, you would be asked to name the new workspace.

If you click on the ‘Existing’ button, you would be asked to selected an existing workspace.

Let us suppose you clicked on the ‘Existing’ button and selected the default workspace.

Your screen should now look, like the one below:

Step-5: Select your import option: ‘Overwrite’ or ‘Merge’:

Step-6: Preview and confirm your import:

From the screenshot above, we can conclude following:

#1 We are going to import 54 new tags.

#2 We are going to import 57 new triggers.

#3 We are going to import 98 new variables.

Click on the ‘View detailed Changes’ link to get more details about the new tags, triggers and variables that you are going to import:

Step-7: Click on the ‘Confirm’ button.

How to import a GTM Recipe?

If you want to import a GTM recipe then you should either:

#1 Import the shared container file to a new workspace and then select the ‘overwrite’ option (Recommended)

#2 Import the shared container file to an existing workspace and then merge the selected workspace with content of the imported container file.

If you used the ‘overwrite’ option while importing a GTM recipe to an existing workspace then all your existing tags, triggers and variables in selected workspace will be deleted and replaced by the contents of the shared imported container:

So you could end up losing all your current work.

Be very careful, how you choose to import a GTM recipe.

Learn about the Google Analytics Usage Trends Tool

The Google Analytics usage trend is a new tool which is used to visualise trends in your Google Analytics data and to perform trend analysis.


Take your knowledge of Web Analytics to the next level. Checkout my web analytics training course.

Take your Analytics knowledge to the next level. Checkout my Best Selling Books on Amazon

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Himanshu Sharma

Certified web analyst and founder of OptimizeSmart.com

My name is Himanshu Sharma and I help businesses find and fix their Google Analytics and conversion issues. If you have any questions or comments please contact me.

  • Over eleven years' experience in SEO, PPC and web analytics
  • Google Analytics certified
  • Google AdWords certified
  • Nominated for Digital Analytics Association Award for Excellence
  • Bachelors degree in Internet Science
  • Founder of OptimizeSmart.com and EventEducation.com

I am also the author of three books:

error: Alert: Content is protected !!