tastytrade: Trade Options, Futures, Stocks, & More { window.gtag(‘consent’, ‘default’, { ad_storage: getConsentState(ONETRUST_CATEGORIES.targeting, event.detail), ad_user_data: getConsentState(ONETRUST_CATEGORIES.targeting, event.detail), ad_personalization: getConsentState(ONETRUST_CATEGORIES.targeting, event.detail), analytics_storage: getConsentState(ONETRUST_CATEGORIES.performance, event.detail), functionality_storage: getConsentState(ONETRUST_CATEGORIES.functional, event.detail), personalization_storage: getConsentState(ONETRUST_CATEGORIES.strictlyNecessary, event.detail), security_storage: getConsentState(ONETRUST_CATEGORIES.strictlyNecessary, event.detail), ‘wait_for_update’: 500, }); }); function OptanonWrapper() { var OnetrustActiveGroups = window.OnetrustActiveGroups || []; if (OnetrustActiveGroups.indexOf(‘C0002’) != -1 && OnetrustActiveGroups.indexOf(‘C0004’) != -1) { gtag(‘consent’, ‘update’, { ‘analytics_storage’: ‘granted’, ‘ad_storage’: ‘granted’ }); } else if (OnetrustActiveGroups.indexOf(‘C0002’) != -1) { gtag(‘consent’, ‘update’, { ‘analytics_storage’: ‘granted’ }); } else if (OnetrustActiveGroups.indexOf(‘C0004’) != -1) { gtag(‘consent’, ‘update’, { ‘ad_storage’: ‘granted’ }); }; setTimeout(function() { (function(w,d,s,l,i){ w[l]=w[l]||[];w[l].push({‘gtm.start’: new Date().getTime(), event: ‘gtm.js’}); var f=d.getElementsByTagName(s)[0], j=d.createElement(s), dl=l!=’dataLayer’?’&l=’+l:”; j.async=true; j.src=’https://www.googletagmanager.com/gtm.js?id=’+i+dl; f.parentNode.insertBefore(j,f); })(window,document,’script’,’dataLayer’,’GTM-M9CJBHB’); }, 3000); } ]]> { item.addEventListener(“click”, function () { console.log(“clicked”); window._uxa = window._uxa || []; window._uxa.push([ “setQuery”, location.search + (location.search ? “&” : “?”) + “artif-pv-cs”, ]); window._uxa.push([ “trackPageview”, window.location.pathname + window.location.hash.replace(“#”, “?__”), ]); window._uxa.push([“setQuery”, location.search]); }); }); document.querySelectorAll(“.lightbox-close”).forEach((element) => { element.addEventListener(“click”, function () { console.log(“X clicked”); window._uxa = window._uxa || []; window._uxa.push([“setQuery”, location.search]); window._uxa.push([ “trackPageview”, window.location.pathname + window.location.hash.replace(“#”, “?__”), ]); }); }); document .querySelector(“body”) .addEventListener(“click”, function firstBody() { document.querySelectorAll(“.popup”).forEach((element) => { if (element.style.display == “block”) { console.log(“opened”); document .querySelector(“body”) .addEventListener(“click”, function secondBody(e) { if (e.target.classList.contains(“lightbox-dim”)) { console.log(“closed”); window._uxa = window._uxa || []; window._uxa.push([“setQuery”, location.search]); window._uxa.push([ “trackPageview”, window.location.pathname + window.location.hash.replace(“#”, “?__”), ]); document .querySelector(“body”) .removeEventListener(“click”, secondBody); } else { // your code console.log(“testting”); document .querySelector(“body”) .removeEventListener(“click”, secondBody); } }); } }); }); ]]>
Source