I’ve written a completely revamped version of this toolset for Google Tag Manager V2.
Well, I just yesterday published the first of my GTM API tools (the Container Visualizer), and I vowed that I wouldn’t release the other tools for a number of reasons.
The reasons were good, in my opinion (especially the part about the tools being ugly as crap), but on the other hand I don’t want to keep anyone away from the amazing potential of the new API.
So here are all the tools I’ve written so far. Note that all tools have been written for the “old UI”, i.e. there are no triggers or variables that you can manage yet. I’ll get around to treating these new features in future releases.
Feel free to play around. There are surely errors here and there, and I’d be grateful if you could e-mail or Tweet me the trace stack what you’ll see if you encounter an error.
You can find the tools here: www.gtmtools.com.
Also, be patient. It’s still running on the free App Engine quota, because I don’t want to start asking for money from people who want to use these tools. I’ll see if I can upgrade to better quotas in the near future.
The Simmer Newsletter
Follow this link to subscribe to the Simmer Newsletter! Stay up-to-date with the latest content from Simo Ahava and the Simmer online course platform.
The first tool lets you copy entire containers from one account to another. Cloning a container means cloning everything in it, apart from user permissions. So you’ll see your tags, rules, and macros all whooshing from one account to another.
Here’s how it works:
Choose an account from which you want to transfer the containers
Choose an account to which you want to transfer the containers
Choose one or multiple containers from the source column
Click “Move Containers”
If everything is fine, click “CLONE CONTAINERS” to start cloning
You won’t be able to clone a container within the same account, nor can you copy a container if a container with the same name already exists in the target account.
Tag / Rule / Macro Cloner
The three other cloners can be bunched up into one description, since they have a very similar mode of operation. Basically, you choose a source container and a target container, and then the assets you want to clone.
The tool prevents assets with the same name being copied, and I might add an option to either overwrite or add a (copy) or something if there is a name conflict.
Another thing to note is that the cloner only clones the “shell” of the tag, rule, or macro. If there are references within these assets to other assets (tags macros, rules referencing macros, and macros referencing other macros), these dependencies are NOT cloned in this version, so you’ll have to remember to go through the new assets and clone any dependencies that are missing. Otherwise your container will not publish, as it will alert that a macro which doesn’t exist has been referred to.
And here’s how the cloners work:
Choose source account and container
Choose target account and container
You can sort the results from A to Z, and you can show Macro and Tag types by clicking the respective buttons
Choose the assets you want to copy from the source container
Click “Move Tag(s) / Rule(s) / Macro(s)”
If the move is successful, you’ll see the assets-to-be-cloned in the target container with an asterisk (*) next to them
Click “CLONE TAGS / RULES / MACROS” to start the cloning process
Please let me know if you run into trouble. I know there are some errors that still pop up every now and then.
I wrote about the Container Visualizer in a recent post, so be sure to read that. It’s definitely my favorite tool of the bunch!
These tools showcase the powers of the API. You can really do awesome stuff, and save a LOT of time.
Future releases of the tools will include:
Mass Update tool, which lets you add a condition to multiple rules at once, or a rule to multiple tags at once
Cloners for the new UI assets (triggers and variables)
General support for “GTM 2.0” (the new UI and assets)
Some sort of dependency checking for the cloners, which would let you copy all dependencies (e.g. linked macros and rules) as well
I’m always happy to receive feedback, but I’d like to remind you that I’m not a professional product developer, nor am I looking to productize these tools or make them something they aren’t. At least for now. I really wanted to just show what the API can do, and create little tools which I want to use myself. I’ve been using the Cloner tools for some time now, and they’ve made my life SO much easier.