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 -->
|
||||
{{ with .counterDev }}
|
||||
<script>
|
||||
if (
|
||||
!sessionStorage.getItem("_swa") &&
|
||||
document.referrer.indexOf(location.protocol + "//" + location.host) !== 0
|
||||
) {
|
||||
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>
|
||||
<script src="https://cdn.counter.dev/script.js"
|
||||
data-id="{{ .id }}"
|
||||
data-utcoffset="1"
|
||||
></script>
|
||||
{{ end }}
|
||||
|
||||
<!-- GoatCounter -->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue