Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmruz Hossain <hossainemruz@gmail.com>2022-10-18 19:06:22 +0300
committerGitHub <noreply@github.com>2022-10-18 19:06:22 +0300
commit33c10915a8cb1207f7efdedb5ddf1eb30b15ab97 (patch)
tree9523504a58448e90e0465e3a9d7b262a49dc6cfe
parent0e8e182e335697229c71feda4a8e4b7b8112acc7 (diff)
Fix counter.dev analytics (#674)
-rw-r--r--layouts/partials/analytics.html24
1 files changed, 4 insertions, 20 deletions
diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html
index 11d507d..be713af 100644
--- a/layouts/partials/analytics.html
+++ b/layouts/partials/analytics.html
@@ -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 -->