Fixed analytics pageview being sent on localhost

This commit is contained in:
Kasper Rynning-Tønnesen
2018-02-02 12:37:27 +01:00
parent 6d53455d41
commit ea0a18e5dd
3 changed files with 13 additions and 7 deletions

View File

@@ -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();

View File

@@ -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("/");