mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed analytics pageview being sent on localhost
This commit is contained in:
@@ -8,7 +8,9 @@ var Channel = {
|
||||
mobile_beginning = Helper.mobilecheck();
|
||||
var side = Helper.mobilecheck() ? "left" : "right";
|
||||
|
||||
ga('send', 'pageview');
|
||||
if(window.location.hostname != "localhost") {
|
||||
ga('send', 'pageview');
|
||||
}
|
||||
|
||||
window.onpopstate = function(e){
|
||||
Channel.onepage_load();
|
||||
|
||||
@@ -376,7 +376,9 @@ var Frontpage = {
|
||||
//Materialize.toast('<p id="aprilfools">We suck at pranks..<a class="waves-effect waves-light btn light-green" style="pointer-events:none;">Agreed</a></p>', 100000);
|
||||
}
|
||||
|
||||
ga('send', 'pageview');
|
||||
if(window.location.hostname != "localhost") {
|
||||
ga('send', 'pageview');
|
||||
}
|
||||
|
||||
window.onpopstate = function(e){
|
||||
var url_split = window.location.href.split("/");
|
||||
|
||||
@@ -34,12 +34,14 @@
|
||||
<link rel="icon" id="favicon" type="image/png" sizes="16x16" href="/assets/images/favicon-16x16.png">
|
||||
<link rel="mask-icon" href="/assets/images/safari-pinned-tab.svg" color="#2d2d2d">
|
||||
<script type="text/javascript">
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
if(window.location.hostname.indexOf("zoff.me") >= 0) {
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '***REMOVED***', 'auto');
|
||||
ga('create', '***REMOVED***', 'auto');
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user