Importing and Exporting Container Files in Google Tag Manager

What is the ‘export container’ feature in Google Tag Manager?

Through the ‘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 a 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.

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 the 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 the GTM export container feature.

If you want to share a particular container version or workspace, you can do that via the GTM export container feature. The GTM export container feature is basically the equivalent to downloading a particular container version or workspace.

If you want to take a 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)

Follow the steps below:

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

Step-2: Click on the ‘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.

What is the container file and where can you 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 includes 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 includes 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 the import container feature in Google Tag Manager?

Through the import container feature, you can import a container file (workspace or version file) to your GTM account.

When the container file contains a 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 in handy when you need to set up the 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.

If you want to share your GTM configurations for video tracking with a third party, you can do that via the 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 gives 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 the 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 a conflicting tag if it carries the same name as the imported tag and its contents are also the same to the contents of the imported tag. The 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 select 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 the 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 the 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 the selected workspace will be deleted and replaced by the contents of the shared imported container:

Because of this, you could end up losing all your current work so be very careful, how you choose to import a GTM recipe.

Related Articles

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

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.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

Himanshu Sharma

Digital Marketing Consultant and Founder of Optimizesmart.com

Himanshu helps business owners and marketing professionals in generating more sales and ROI by fixing their website tracking issues, helping them understand their true customers' purchase journey and helping them determine the most effective marketing channels for investment.

He has over 12 years of experience in digital analytics and digital marketing.

He was nominated for the Digital Analytics Association's Awards for Excellence. The Digital Analytics Association is a world-renowned not-for-profit association that helps organisations overcome the challenges of data acquisition and application.

He is the author of four best-selling books on analytics and conversion optimization:

error: Alert: Content is protected !!