March 18, 2019
How to copy Google Tag Manager tags between containers?
I occasionally receive the following question: how can someone copy Google Tag Manager tags between containers? And that’s a totally valid question. Instead of just manually copying field by field from one container to another you could just simply hit Copy-Paste and move assets between containers.
Unfortunately, GTM does not offer such a feature as built-in functionality, therefore, there must be some other workarounds used.
In this blog post, I’ll give an overview of 3 options (actually, 2.5) on how can you copy Google Tag Manager tags (triggers or variables) between container. If you are already an intermediate (or higher) GTM user, you’ll probably not learn anything new here. However, aspiring beginners should definitely benefit from it.
Built-in Export-Import feature
This is not a full solution, that’s why I said that I’ll present 2.5 options (not 3) on how to copy tags, triggers, and variables.
In case you didn’t know (which is very unlikely), GTM allows users to use import and export features in order to move the content of the entire container from one container to another. However, there’s one big caveat: you cannot move part of the container, you can only export the entire content.
Even though this looks pretty limiting (in the context of this blog post), it is still very useful. After all, thanks to import/export such things as Google Tag Manager recipes exist. If you constantly work with multiple Google Tag Manager containers and every month/week you get access to new ones, you could prepare a container template that includes the most common tracking solutions (e.g. outbound link clicks, document downloads, etc.).
That container template could be then be imported to every new container you use. #timesaving
In this post, I will not explain how to decide which tags, triggers, and variables should be included in that container template. That’s up to you, your company/agency and your internal work principles. So I’ll skip that part.
But if you already have created separate Google Tag Manager container just to make it as a template, go to its Admin section (1) and in the Container column, choose Export Container (2).
Choose the workspace or the version that you want to export
…. and you’ll start seeing a generated code. Save it as a text file.
That’s it! Next time you receive a new project and a GTM container, just import that container.
But if you actually want to copy/paste just single items between containers, the built-in GTM functionality will not be very helpful (at least in the beginning of 2019). That’s why you should rely on the next two options.
GTM Copy Paste extension
Back in 2018, Julian from Measureschool created a cool Google Chrome Extension called GTM Copy Paste. It enriches the UX of Google Tag Manager by adding a tweak: you can actually do the right-click on an item in your GTM container (tag, trigger, or variable), copy and then paste it in another GTM container.
And that is super neat! Here’s how it works. First, you need to install the extension to your Chrome browser. After that, click the icon and you’ll be asked to log in. Use the same account that has access to those Google Tag Manager container (you’ll be working with).
Then go to your Google Tag Manager interface and do the right-click on the asset that you want to copy (this will fluently work in the Overview of your container, as long as the dedicated pages of tags, triggers, and variables).
If you don’t see the option to “Add to GTM Copy/Paste”, you should refresh the page. If the issue still persists, contact Julian with the bug report.
Back to copying, every time you click “Add to GTM Copy/Paste”, a number will increase in the extension’s icon. It indicates how many assets are currently selected.
If you want to see the full list of the selected items, click extension’s icon.
See something you don’t like? Hit the trashcan next to it.
After you have selected all the items that you want to move from container A to container B, the time has come to paste. In your Google Tag Manager interface, switch to container B.
Then click on the GTM Copy Paste icon and press the Paste button.
That’s where the magic starts! You’ll see the progress bar of all items that are being pasted to the container B. If you want to see the full list of assets that were added to the container B, head over to the Overview of the container (in GTM interface) to see all the changes (including those that were done by you before doing the Paste Magic).
Want to learn more about this extension? Here is an intro video.
If you don’t use Google Chrome or if you don’t prefer Julian’s extension in general, another solution how to copy Google Tag Manager tags, triggers or variables is to use Simo Ahava’s GTMtools.com.
In fact, it offers multiple useful GTM-related features (like Container Visualization). However, in this guide, I’ll solely focus only on copying container items.
To get started, go to gtmtools.com and press Sign in button. Important: if you have used this tool some time ago, the authorization process might not work for you properly (that’s why you should carefully read the large red notification on the homepage).
You’ll be asked to give permissions to access various stuff in Google Tag Manager.
Press Allow. If there are any additional steps (from Google Authorization), complete them as well. Long story short, follow all steps until you log in to GTM Tools.
Inspecting the container
Get started by clicking GTM Account dropdown in the top menu bar and choose the account from which you want to copy/export something. In my case, it’s a mysterious website called Demo 8.
Each Google Tag Manager account can have multiple containers. After choosing an account, click three dots next to the desired container and then choose to Inspect.
Next, you’ll see the content of a container split into three groups, tags, triggers, and variables.
Box of each group is clickable and can be expanded, and this is exactly what we’ll do. Say, that we want to check which tags are available, click Tags.
Picking up the goods
What we’re going to do next, is “shopping”. Start adding all needed tags, triggers, and variables to the cart. You can do that by clicking on a green Plus icon located next to each container element (asset). If the icon is a red minus, this means that the item has been already selected.
By the way, you can do “shopping” in multiple containers (e.g. pick a tag from container A and a trigger from container C). Later, all assets (added to the cart) will be cloned to another container.
After you’re done with picking all the goods, go to the Cart (by clicking the button in the top right corner of GTM Tools).
We’re getting close. Let’s clone everything from the cart to the target GTM container, click the green Clone to container button.
In the confirmation popup you’ll need to:
- Choose the target GTM account and container
- Choose the workspace within that GTM container.
Confirm the action by clicking Clone button.
Done! All the items you have added to the cart are now copied to the container B. Just as it was with Julian’s Chrome extension, you can see all changes in the Overview of the container.
It does not matter which copying technique did you choose. You need to test whether everything is working properly. It does not matter how small the change was, don’t trust yourself (at least, I don’t trust myself). I have fallen into this issue too often in the past when an innocent change broke something that I totally forgot.
If needed, modify those newly added tags, triggers, and variables. This includes (but not limited to) changing Tracking IDs (e.g. Google Analytics or Facebook Pixel).
Last but not least, enable GTM Debug mode and test, test, test.
Last words on how to copy Google Tag Manager tags between containers
Even though the blog post titles mentions only tags, in this guide, I did not limit only to them. Feel free to move triggers and variables as well. Thanks to wonderful contributions from Simo Ahava and Julian Juenemann, copy-pasting in GTM isn’t a difficult or time-consuming task after all.
Using Chrome? Copy paste with Julian’s browser extension
Don’t use/like Chrome? Use Simo’s gtmtools.com
Want to copy the entire container? Use GTM’s built-in import and export features
On a side note, I’d like to give additional praise to the entire GTM/Analytics community for creating and sharing stuff with others. GTM Copy Paste and GTM Tools are great examples of this. People create, people share, people teach, people learn. The openness of the industry is one of the main reasons why I like being here. Every week, I learn something new and there is a huge mountain of possible learning topics waiting ahead. Damn, it feels good 🙂