From e1603e19bf020ab86aedfe114a3e43684e7944a6 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Tue, 9 Apr 2019 14:54:58 +0200 Subject: [PATCH] Switch back to parameter based url tracking --- main.go | 2 +- static/kis3.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index d5e2139..9a23546 100644 --- a/main.go +++ b/main.go @@ -67,7 +67,7 @@ func startListening() { func trackView(w http.ResponseWriter, r *http.Request) { w.Header().Set("Cache-Control", "max-age=0") - url := r.Header.Get("Referer") // URL of requesting source + url := r.URL.Query().Get("url") ref := r.URL.Query().Get("ref") ua := r.Header.Get("User-Agent") if !(r.Header.Get("DNT") == "1" && appConfig.dnt) { diff --git a/static/kis3.js b/static/kis3.js index 6975592..46d89d5 100644 --- a/static/kis3.js +++ b/static/kis3.js @@ -1,8 +1,8 @@ (function () { var request = new XMLHttpRequest(); - var url = document.currentScript.src.replace("kis3.js", "view?"); + var url = document.currentScript.src.replace("kis3.js", "view?url=" + window.decodeURI(window.location.href)); if (document.referrer && document.referrer.length > 0) { - url += "ref=" + window.decodeURI(document.referrer); + url += "&ref=" + window.decodeURI(document.referrer); } request.onload = function () { if (request.status >= 200 && request.status < 300) {