Custom Event Listeners For GTM
Create your own event listener for Google Tag Manager with this guide.
Many times I've been in a situation where I wish GTM had a listener such as 'change' or 'reset' out-of-the-box. It's possible and likely that the family of available listeners will be extended in the near future, but you can always create your own listeners, while still observing best practices and the design patterns of GTM's own proprietary features.
In this guide, you'll create a generic event handler macro which serves all your custom listener needs. The point is that you only need to create a simple listener tag (Custom HTML) for your listeners, and you can then reuse this generic macro as the callback of each new listener. It's really dead simple.
I use an example of the Change listener in the guide, but you can use pretty much any of the supported event types, or if you're a real tag master / JS wizard, you can use your own custom events. #gde #googleanalytics #blogpost