remove flag checks via EJS (#387)

This commit is contained in:
Hetu Nandu 2020-08-21 12:59:31 +05:30 committed by GitHub
parent 2e731b5e11
commit 078a6a3a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,27 +16,23 @@
transition: all ease-in 0.3s;
}
</style>
<% if("%REACT_APP_INTERCOM_APP_ID%"[0] !== "%" && "%REACT_APP_CLOUD_HOSTING%" !== "%") { %>
<script type="text/javascript">
// INTERCOM SETUP
const APP_ID = "%REACT_APP_INTERCOM_APP_ID%"
const CLOUD_HOSTING = "%REACT_APP_CLOUD_HOSTING%"
if (APP_ID.length && CLOUD_HOSTING.length) {
(function () { var w = window; var ic = w.Intercom; if (typeof ic === "function") { ic('reattach_activator'); ic('update', w.intercomSettings); } else { var d = document; var i = function () { i.c(arguments); }; i.q = []; i.c = function (args) { i.q.push(args); }; w.Intercom = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/' + APP_ID; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (document.readyState === 'complete') { l(); } else if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })();
}
</script>
<% } %>
<% if("%REACT_APP_GOOGLE_ANALYTICS_ID%"[0] !== "%") { %>
<script async src="https://www.googletagmanager.com/gtag/js?id=%REACT_APP_GOOGLE_ANALYTICS_ID%"></script>
<script>
// GA SETUP
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
<script type="text/javascript">
// INTERCOM SETUP
const APP_ID = "%REACT_APP_INTERCOM_APP_ID%"
const CLOUD_HOSTING = "%REACT_APP_CLOUD_HOSTING%"
if (APP_ID.length && CLOUD_HOSTING.length) {
(function () { var w = window; var ic = w.Intercom; if (typeof ic === "function") { ic('reattach_activator'); ic('update', w.intercomSettings); } else { var d = document; var i = function () { i.c(arguments); }; i.q = []; i.c = function (args) { i.q.push(args); }; w.Intercom = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/' + APP_ID; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (document.readyState === 'complete') { l(); } else if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })();
}
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=%REACT_APP_GOOGLE_ANALYTICS_ID%"></script>
<script>
// GA SETUP
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', "%REACT_APP_GOOGLE_ANALYTICS_ID%");
</script>
<% } %>
gtag('config', "%REACT_APP_GOOGLE_ANALYTICS_ID%");
</script>
</head>
<body>