Filter a subset of Tags from exported Google Tag Manager (GTM) containers
You want to duplicate a GTM container but only need a subset of the tags.
Currently:
- A single Folder name (this is a folder in GTM)
Could be enhanced without much difficulty to also support:
- Multiple Folder names
- Multiple Tag names
- It will (recursively) include Triggers and Variables that the Tags depend on
- It will include original Folder names for all included Triggers and Variables, as well as the original Folder that matched your search and contains the tags
See https://support.google.com/tagmanager/answer/6106997?hl=en
npm i
Create your own or modify the existing config.example.json
file.
Properties for configuration:
-
folders
A search string used to match folders and extract the Tags within them. Can be a partial match. No regex.
Example:
{
"folders": "Folder Name"
}
npm run start -- --config=config.json --input=containers/GTM-XXXXXX_workspaceXXX.json
E.g.
containers/GTM-XXXXXX_workspaceXXX-filtered.json
See https://support.google.com/tagmanager/answer/6106997?hl=en