Fix counter.dev analytics (#674)
This commit is contained in:
parent
0e8e182e33
commit
33c10915a8
1 changed files with 4 additions and 20 deletions
|
@ -10,26 +10,10 @@
|
||||||
|
|
||||||
<!-- Counter.dev -->
|
<!-- Counter.dev -->
|
||||||
{{ with .counterDev }}
|
{{ with .counterDev }}
|
||||||
<script>
|
<script src="https://cdn.counter.dev/script.js"
|
||||||
if (
|
data-id="{{ .id }}"
|
||||||
!sessionStorage.getItem("_swa") &&
|
data-utcoffset="1"
|
||||||
document.referrer.indexOf(location.protocol + "//" + location.host) !== 0
|
></script>
|
||||||
) {
|
|
||||||
fetch(
|
|
||||||
"https://counter.dev/track?" +
|
|
||||||
new URLSearchParams({
|
|
||||||
referrer: document.referrer,
|
|
||||||
screen: screen.width + "x" + screen.height,
|
|
||||||
user: "{{ .id }}",
|
|
||||||
utcoffset: "1",
|
|
||||||
}),
|
|
||||||
{{ with .referrerPolicy }}
|
|
||||||
{ referrerPolicy: "{{ . }}" }
|
|
||||||
{{ end }}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
sessionStorage.setItem("_swa", "1");
|
|
||||||
</script>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<!-- GoatCounter -->
|
<!-- GoatCounter -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue