How to Import & Export GTM Lookup Tables into Spreadsheets
In this blog post, I want to describe one of the features of the GTM tool chrome extension that we’ve made here at MeasureMinds. This feature allows you to import and export GTM tables into spreadsheets.
Why Would Importing/Exporting GTM Lookup Tables to Spreadsheets be Useful?
Now there are multiple ways that you could use this tool and ultimately it is down to you how you do that. However, an example of where this may be useful is in situations where you have a lookup table variable filled with a huge list of domains or different country codes.
The above can be a problem because it can take a long time to change the values inside the tables within GTM manually. We find it’s much easier to copy everything to spreadsheets and change values much quicker because you can use formulas and the larger range of tools available.
But for smaller lookup tables, you won’t find as much use because you can do everything manually inside GTM.
Now you have decided whether this will be useful to you or not, we can tell you how to use it.
First of all, here’s a link to the extension:
Install the Chrome Extension
Once you have installed the extension, go to your GTM account and navigate to any lookup table variable. You will see 3 new buttons at the top:
- Export sheets
- Import sheets
- Export CSV
Exporting a Lookup Table
You can now export the lookup table as a CSV file. This can be helpful if you just need to grab all the values from a huge table with lots of data. Otherwise, you’ll be clicking on each row to copy all values, which would take you lots of time.
Exporting a Lookup Table to Google Sheets
Another way is to export all values to a Google Sheet. If you are using the ‘Export Sheets’ button for the first time, the extension will ask you for Google Drive permissions:
You need to click the Allow button. Please be aware, the extension won’t have access to your existing Google Docs. It can only create new Sheets and have access to them.
After the export is finished, you will get a modal window with a link to a Google Sheet with the values.
Add More Rows and Change Values if Needed
The Google Sheet will have all the table’s rows and default values. If needed, you can add more rows and change existing values.
After the export, the ‘Import Sheet’ button will become active. The extension saves the URL of the last exported sheet in storage and now you can import back all the changes.
For example, I can change all the values in the sheet and add a few rows:
Import Sheet Into Google Tag Manager Interface
Now I can go back to the GTM interface and click the ‘Import Sheets’ button.
As soon as the import is complete a modal window will open and a JSON file will be downloaded.
Then I can import the JSON file into GTM by going to the ‘admin tab’ and clicking ‘import container’:
The import container interface will now open:
Choose the container file and select the recently exported .json file. Select the existing workspace or create a new one.
Please don’t forget to select the ‘merge’, not the ‘overwrite’ option as we only need to change one variable. If you select ‘overwrite’, it will delete all other tags, variables and triggers. But if you do make this mistake, you can always go back to the previous GTM version.
Now you have all the changes available to you in GTM.
The import option is available only for a Google Sheet export.
This feature can be very handy if you want to bulk update GTM using Google Sheets macros or if you want to blend values with values from other Sheets.
I hope this extension saves you time and makes working with large GTM tables not so painful.
Please share your opinion. Do you find this export/import useful? What did you use it for? What other features do you need for your everyday GTM tasks? We might be able to make an app for you!
- GTAG within GTM – The what, why and how! - 17/11/2023
- Results of GTMgrader.ai Competition - 17/10/2023
- What does “Review your updated GA4 property” email from Google mean? - 04/08/2023