Elwin's Blog

an activist who likes to think

Month: April 2021

front cover

maintainable code for google tag manager with Universal Analytics

Posted on

TL;DR Use data attribute starting with data-gtag- on the element you want to watch for triggering event, if that event is on a component that will be used in multiple places, and you only want to watch some of them, choose to pass data-gtag as the class name on the component you want to watch, to collect complicated data in an object or array type, use this instead:

Continue reading