Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 626a8fd

Browse files
committed
send referrer
1 parent 53f5815 commit 626a8fd

File tree

2 files changed

+30
-36
lines changed

2 files changed

+30
-36
lines changed

src/root_files/app/index.html

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@
5050
var is_logged_in = client_info && client_info['token'];
5151
window.location.href = (lang || 'en').toLowerCase() + '/' + (is_logged_in ? 'trading' : 'home') + '.html' + window.location.search;
5252
}
53-
function isDelayedRedirect() {
54-
if (isGtmApplicable() && !redirectTimeOut) {
55-
redirectTimeOut = setTimeout(redirect, 5000);
56-
} else {
57-
clearTimeout(redirectTimeOut);
58-
redirect();
59-
}
60-
}
6153
function isGtmApplicable() {
6254
return /(www|staging)\.binary\.(com|me)/i.test(window.location.hostname);
6355
}
@@ -66,11 +58,12 @@
6658
dataLayer.push({
6759
'event': 'page_load',
6860
'eventCallback': function() {
69-
isDelayedRedirect();
70-
}
61+
redirect();
62+
},
63+
'referrer': document.referrer
7164
});
7265
} else {
73-
isDelayedRedirect();
66+
redirect();
7467
}
7568
}
7669

src/root_files/app_2/index.html

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,22 @@
4949
var is_logged_in = client_info && client_info['token'];
5050
window.location.href = (/\/app\//.test(window.location.pathname) ? '' : 'app/') + (lang || 'en').toLowerCase() + '/trade' + window.location.search;
5151
}
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+
}
6768

6869
if (document.referrer) {
6970
localStorage.setItem('index_referrer', document.referrer);
@@ -84,21 +85,21 @@
8485
}
8586
ws.close();
8687
redirect();
87-
// pushEvent(); // we need website_status.clients_country
88+
pushEvent(); // we need website_status.clients_country
8889
}
8990
};
9091
}
9192
</script>
9293
</head>
9394
<body>
94-
<!--&lt;!&ndash; Google Tag Manager &ndash;&gt;-->
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-
<!--&lt;!&ndash; End Google Tag Manager &ndash;&gt;-->
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 -->
103104
</body>
104105
</html>

0 commit comments

Comments
 (0)