mirror of
https://github.com/danbulant/Mangades
synced 2026-06-20 06:41:16 +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";
|
||||
|
||||
let skipFirst = true;
|
||||
let last = window.location.pathname;
|
||||
$afterPageLoad(page => {
|
||||
if(skipFirst) return skipFirst = false;
|
||||
if(window.goatcounter) window.goatcounter.count({
|
||||
path: page.path,
|
||||
path: window.location.pathname,
|
||||
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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue