GTM Tools Add-on For Google Sheets
In this first iteration, the tools feature a Documentation builder, which lets you automatically generate documentation for the latest version of your Google Tag Manager container, tags, triggers, and variables. In addition to this, the toolset features a Push changes to Notes functionality, which lets you automatically mass update the
Notes field across your tags, triggers, and variables.
How to get it
In Google Sheets, open the Add-ons menu, and click Get add-ons.
You should see the Chrome web store window open. Enter “GTM Tools by Simo Ahava” into the search field and press Enter. You should see the add-on appear in the search results.
Click the + FREE button. You will be asked to sign in with your Google ID, and then approve the add-on access to your data. The add-on requires read and write access to your Google Tag Manager data, and read and write access to your Google Sheets account.
You are then ready to use the tool!
You should see the GTM Tools by Simo Ahava menu item in the Add-ons menu. You might need to reload the page if it isn’t there, or if it seems to be missing all its menu items.
When you click Build documentation, the add-on will prompt you for a Google Tag Manager account and container. The list will include all containers your current logged in Google user ID has access to. Once you’ve selected a container, click Build to start the process.
The builder creates four new sheets: one for your container version, and one each for your tags, triggers, and variables.
As you can see, each sheet is prefixed with the container ID.
Each sheet will contain useful information about your container, based on the Latest version of your container. If no version has been created yet, the documentation builder will not work.
Never rename these default sheets created by the tool! They are necessary for the add-on to work.
Mark changes to Notes
The next thing you can do is manually edit the
Notes field of the tags, triggers, and variables sheets. You can edit or create notes entries for each item, if you wish.
Once you’ve made all the changes to the
Notes fields (changes to other fields are ignored, and you should NEVER, EVER, modify the JSON column), choose Mark changes to Notes in the add-on menu. A new dialog opens.
When you click Mark changes, the tool will go through all the tag, trigger, and variable documentation sheets, and highlight each field that diverges from the latest version. This is to give you a visual clue of which fields have changed values within.
The dialog will also tell you how many fields were highlighted as a result.
Push changes to Notes
Once you’ve made changes to the notes fields, you can push these changes to a GTM container. The container is automatically selected based on the sheet you have active in Google Sheets. So if you have active one of the documentation sheets prefixed for GTM-XXXXX-X, then that will be used as the target container for the push. If you have selected one of the sheets prefixed with GTM-YYYYY-Y, then that will be used, etc.
See the screenshot at the beginning of this article for an example of what the modal looks like when you have a valid sheet selected.
Once you click PUSH CHANGES, the tool will update all the tags, triggers, and variables in the sheets for this container, modifying the
notes field of each to match the changes you made. The changes will be done in the workspace you chose using the selector in the modal.
When the push is complete, the modal will inform you how many changes were made. You can also click a link in the modal to have the tools create a new container version of the workspace you just updated.
This is at your own risk. If the workspace doesn’t validate, it will result in an error. Note that all changes in the workspace will be included in the new version.
After you’ve pushed the changes, you should really create a new version as soon as possible. Otherwise the documentation will always interpret the changes to the notes to be new changes, because they are always compared against the latest container version.
When a new version has been created, you should always re-run Build documentation.
When rebuilding the documentation, the add-on will always show the following prompt if a sheet has already been created by the tool. You will have the option of overwriting the sheet or skipping it in the documentation build process. Unless you’ve made some manual changes to the sheets generated by the documentation (I’d recommend against this), it’s a good idea to always allow the add-on to overwrite the sheets’ contents with the data from the latest version of the container.
Words of caution
For the add-on to work properly, follow the following guidelines:
Never edit the sheet names - it’s imperative that the sheets use the default names created by the add-on
Never delete or modify the named ranges created by the add-on
Never edit values in the JSON column
Changing other column values than
Notes will not do anything. At some point I might add the option to mass update the other fields, too.
What information do you collect?
The GTM Tools by Simo Ahava add-on collects no information from its users. It is an API tool used for managing and updating Google Tag Manager containers, tags, triggers, and variables.
The only thing the add-on logs is the generic Google Cloud Console API usage statistics, which tells the owner how much the enabled APIs are being used, but this data cannot be used to identify users or individual use patterns.
How do you use the information?
No user or usage information is used. The only thing the owner monitors is API usage, so that it can be determined if quotas need to be increased to ensure the tool works smoothly.
What information do you share?
No information is shared with third parties, with other users, with analytics tools, with marketing partners, or any other party.