Capturing the Correct Element in Google Tag Manager
Last updated 24 August 2022: The instructions in this article are no longer that useful, as you can simply use the native JavaScript
Element.closest(selector)method instead of the {{Find Closest}} trick described in this article. Browser support forclosesthas thankfully improved a great deal since this article was originally written.
Google Tag Manager provides us with a bunch of handy triggers, designed to make capturing user interactions on the website much easier. These triggers are part of a paradigm called auto-event tracking, which comprises the Click, Form, History, and JavaScript Error trigger types.
Read More…