sitoctt/static/analytics.js

18 lines
540 B
JavaScript
Raw Normal View History

2024-09-04 02:15:55 +02:00
(function(){
// TODO should use goatcounter script for full proper handling?
if (!["sitoctt.octt.eu.org", "http.sitoctt.octt.eu.org"].includes(location.hostname) || !location.search) {
return;
}
window.addEventListener('load', (function(){
var path = (location.pathname + location.search);
fetch('https://private-analytics-not-for-public-use.octt.eu.org/sitoctt/count?p=' + path /* + '&rnd=' + Date.now() */)
.catch(function(err){
console.error(err);
fetch('https://sitoctt.goatcounter.com/count?p=' + path);
});
2024-09-04 02:15:55 +02:00
}));
})();