gtm-batch-delete

2.0.4 • Public • Published

gtm-batch-delete

Node gadget to delete elements from a GTM container JSON file, specified by an array of element IDs or element names.

Export a Google Tag Manager container then import a new version minus the elements you've specified.

Pre-requisites

Requires NodeJS

Optional installation via NPM

npm i gtm-batch-delete

Imported as a package

const gtmBatchDelete = require('gtm-batch-delete')
// To delete tags by ID
const cleansedContainer = gtmBatchDelete("./path/to/container.json", "tag", "1,2,3")
// To delete triggers by ID
const cleansedContainer = gtmBatchDelete("./path/to/container.json", "trigger", "1,2,3")
// Or if you want to use tag names instead.
const cleansedContainer = gtmBatchDelete("./path/to/container.json", "tag", "tag one,tag two,tag three")

Run via CLI

# To delete tags
node gtmBatchDelete.js --container ./path/to/container.json --type 'tag' --elements 1,2,3
# To delete triggers
node gtmBatchDelete.js --container ./path/to/container.json --type 'trigger' --elements 1,2,3
# Or if you want to use tag names instead
node gtmBatchDelete.js --container ./path/to/container.json --type 'tag' --elements 'tag one,tag two,tag three'

Package Sidebar

Install

npm i gtm-batch-delete

Weekly Downloads

11

Version

2.0.4

License

GPL-3.0-or-later

Unpacked Size

39.8 kB

Total Files

5

Last publish

Collaborators

  • nullish