|
49 | 49 | var is_logged_in = client_info && client_info['token']; |
50 | 50 | window.location.href = (/\/app\//.test(window.location.pathname) ? '' : 'app/') + (lang || 'en').toLowerCase() + '/trade' + window.location.search; |
51 | 51 | } |
52 | | - // function isGtmApplicable() { |
53 | | - // return /(www|staging)\.binary\.(com|me)/i.test(window.location.hostname); |
54 | | - // } |
55 | | - // function pushEvent() { |
56 | | - // if (isGtmApplicable()) { |
57 | | - // dataLayer.push({ |
58 | | - // 'event': 'page_load', |
59 | | - // 'eventCallback': function() { |
60 | | - // redirect(); |
61 | | - // } |
62 | | - // }); |
63 | | - // } else { |
64 | | - // redirect(); |
65 | | - // } |
66 | | - // } |
| 52 | + function isGtmApplicable() { |
| 53 | + return /(www|staging)\.binary\.(com|me)/i.test(window.location.hostname); |
| 54 | + } |
| 55 | + function pushEvent() { |
| 56 | + if (isGtmApplicable()) { |
| 57 | + dataLayer.push({ |
| 58 | + 'event': 'page_load', |
| 59 | + 'eventCallback': function() { |
| 60 | + redirect(); |
| 61 | + }, |
| 62 | + 'referrer': document.referrer |
| 63 | + }); |
| 64 | + } else { |
| 65 | + redirect(); |
| 66 | + } |
| 67 | + } |
67 | 68 |
|
68 | 69 | if (document.referrer) { |
69 | 70 | localStorage.setItem('index_referrer', document.referrer); |
|
84 | 85 | } |
85 | 86 | ws.close(); |
86 | 87 | redirect(); |
87 | | - // pushEvent(); // we need website_status.clients_country |
| 88 | + pushEvent(); // we need website_status.clients_country |
88 | 89 | } |
89 | 90 | }; |
90 | 91 | } |
91 | 92 | </script> |
92 | 93 | </head> |
93 | 94 | <body> |
94 | | -<!--<!– Google Tag Manager –>--> |
95 | | -<!--<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-MZWFF7"--> |
96 | | -<!--height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>--> |
97 | | -<!--<script data-cfasync="false">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':--> |
98 | | -<!--new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],--> |
99 | | -<!--j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=--> |
100 | | -<!--'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);--> |
101 | | -<!--})(window,document,'script','dataLayer','GTM-MZWFF7');</script>--> |
102 | | -<!--<!– End Google Tag Manager –>--> |
| 95 | +<!-- Google Tag Manager --> |
| 96 | +<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-MZWFF7" |
| 97 | +height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> |
| 98 | +<script data-cfasync="false">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
| 99 | +new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
| 100 | +j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
| 101 | +'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
| 102 | +})(window,document,'script','dataLayer','GTM-MZWFF7');</script> |
| 103 | +<!-- End Google Tag Manager --> |
103 | 104 | </body> |
104 | 105 | </html> |
0 commit comments