jlelse
/
kis3
Archived
1
Fork 0

Switch back to parameter based url tracking

This commit is contained in:
Jan-Lukas Else 2019-04-09 14:54:58 +02:00
parent 57cbd62da5
commit e1603e19bf
2 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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) {