Skip to content

Instantly share code, notes, and snippets.

@r14c
Last active May 15, 2024 16:40
Show Gist options
  • Select an option

  • Save r14c/8c69a0570ef29d46b0b32076bf4044b3 to your computer and use it in GitHub Desktop.

Select an option

Save r14c/8c69a0570ef29d46b0b32076bf4044b3 to your computer and use it in GitHub Desktop.
export a list of GTM tags
/**
* 1. go to google tag manager > workspace > tags
* 2. set show rows = ALL
* 3. "inspect elemement" > console
* 4. paste this snippet
*/
(function () {
const qs = document.getElementsByClassName('wd-tag-row')
let result = []
for (let i = 0; i < qs.length; i += 1) {
const name = qs[i].children[1].children[0].text
const type = qs[i].children[2].textContent
result.push(`${name}\t${type}`)
}
console.log(result.join('\n'))
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment