Adding dash to pageview for prettier google-analytics listing

This commit is contained in:
Kasper Rynning-Tønnesen
2018-11-23 12:43:26 +01:00
parent 810c2fe24b
commit 77d215f89f
3 changed files with 9 additions and 3 deletions

View File

@@ -52,7 +52,9 @@ var Channel = {
var side = Helper.mobilecheck() ? "left" : "right";
if(window.location.hostname != "localhost") {
ga('send', 'pageview');
var page = window.location.pathname;
if(page.substring(page.length - 1) != "/") page += "/";
ga('send', 'pageview', page);
}
window.onpopstate = function(e){

View File

@@ -434,7 +434,9 @@ var Frontpage = {
}
if(window.location.hostname != "localhost") {
ga('send', 'pageview');
var page = window.location.pathname;
if(page.substring(page.length - 1) != "/") page += "/";
ga('send', 'pageview', page);
}
window.onpopstate = function(e){

View File

@@ -7,7 +7,9 @@ window.addEventListener("DOMContentLoaded", function(e) {
Helper.setHtml("#contact-container", "Send a mail to us: <a title='Open in client' href='mailto:contact@zoff.me?Subject=Contact%20Zoff'>contact@zoff.me</a>");
Helper.css("#submit-contact-form", "display", "none");
ga('send', 'pageview');
var page = window.location.pathname;
if(page.substring(page.length - 1) != "/") page += "/";
ga('send', 'pageview', page);
if(!Helper.mobilecheck()) {
if(document.querySelector("#iframe-container")) {