Skip to content

Instantly share code, notes, and snippets.

@r14c
Last active May 15, 2024 16:40
Show Gist options
  • Save r14c/8c69a0570ef29d46b0b32076bf4044b3 to your computer and use it in GitHub Desktop.
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
* @link gemini://sunshinegardens.org/~xj9/paste/3b1e5faf0a5767827f8594900b3f0d366c2460edf74f2e711ac3512e2e7df383.gmi
*/
(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 || '').trim()}\t${(type || '').trim()}`)
}
console.log(result.join('\n'))
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment