diff options
author | Emruz Hossain <hossainemruz@gmail.com> | 2022-10-18 19:06:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 19:06:22 +0300 |
commit | 33c10915a8cb1207f7efdedb5ddf1eb30b15ab97 (patch) | |
tree | 9523504a58448e90e0465e3a9d7b262a49dc6cfe | |
parent | 0e8e182e335697229c71feda4a8e4b7b8112acc7 (diff) |
Fix counter.dev analytics (#674)
-rw-r--r-- | layouts/partials/analytics.html | 24 |
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 --> |