- Enforce a timeout of 2 seconds if one is not provided. See https://www.simoahava.com/gtm-tips/use-eventtimeout-eventcallback.
- Guarantee the callback, if provided, will execute even if Tag Manager fails or is blocked by the browser. See https://stackoverflow.com/questions/60489452/should-i-use-eventcallback-for-gtm-before-redirecting.
Plop this function right after your Tag Manager embed code to make it available to your entire app. Minified with https://www.toptal.com/developers/javascript-minifier.