mirror of
https://github.com/danbulant/Mangades
synced 2026-07-07 12:00:36 +00:00
fix analytics
This commit is contained in:
parent
cb8ac1b3a9
commit
2cdcdd979a
1 changed files with 5 additions and 3 deletions
|
|
@ -3,14 +3,16 @@
|
||||||
import { afterPageLoad } from "@roxi/routify";
|
import { afterPageLoad } from "@roxi/routify";
|
||||||
|
|
||||||
let skipFirst = true;
|
let skipFirst = true;
|
||||||
|
let last = window.location.pathname;
|
||||||
$afterPageLoad(page => {
|
$afterPageLoad(page => {
|
||||||
if(skipFirst) return skipFirst = false;
|
if(skipFirst) return skipFirst = false;
|
||||||
if(window.goatcounter) window.goatcounter.count({
|
if(window.goatcounter) window.goatcounter.count({
|
||||||
path: page.path,
|
path: window.location.pathname,
|
||||||
title: page.title,
|
title: page.title,
|
||||||
referrer: page.prev.path
|
referrer: last
|
||||||
});
|
});
|
||||||
else console.warn("Page change; GoatCounter not loaded (yet?)", page.path);
|
else console.warn("Page change; GoatCounter not loaded (yet?)", window.location.pathname);
|
||||||
|
last = window.location.pathname;
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue