Add this to before you load any 3p (especially GTM) in the document.
What it does is when it executes:
- for click, auxclick, mousedown, keyup and submit, installs a
documentleveladdEventListeneroverride that intercepts added listeners if it's likely they from from a 3p (-> based on the 3rd argument passed to the fn)
On the document load event (so that it executes after GTM etc.):
- for the same events, installs a
document.bodylevel override - overrides
dataLayer.pushandgtag()to yield first