Merge pull request #132 from Worklenz/chore/add-google-analytics
fix(index.html): update Google Analytics integration to load only in …
This commit is contained in:
@@ -26,13 +26,21 @@
|
|||||||
})(window, document, "clarity", "script", "dx77073klh");
|
})(window, document, "clarity", "script", "dx77073klh");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<!-- Google Analytics -->
|
<!-- Google Analytics (only on production) -->
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7KSRKQ1397"></script>
|
<script type="text/javascript">
|
||||||
<script>
|
if (window.location.hostname === 'app.worklenz.com') {
|
||||||
|
var gaScript = document.createElement('script');
|
||||||
|
gaScript.async = true;
|
||||||
|
gaScript.src = 'https://www.googletagmanager.com/gtag/js?id=G-7KSRKQ1397';
|
||||||
|
document.head.appendChild(gaScript);
|
||||||
|
|
||||||
|
gaScript.onload = function() {
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag() { dataLayer.push(arguments); }
|
function gtag(){dataLayer.push(arguments);}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
gtag('config', 'G-7KSRKQ1397');
|
gtag('config', 'G-7KSRKQ1397');
|
||||||
|
};
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user