mirror of
https://github.com/Queer-Lexikon/regenbogenkarte
synced 2024-12-01 08:29:09 +00:00
b15bfc0a73
To enable the goatcounter integration, the variable VITE_QUEER_LEXIKON_PRIVATE must be set to "true". This check is intentionally added for development environments so that all dev environments from possible forks do not modify the statistics by accident.
22 lines
493 B
TypeScript
22 lines
493 B
TypeScript
declare global {
|
|
interface Window {
|
|
goatcounter: {
|
|
path: (p: any) => string;
|
|
};
|
|
}
|
|
}
|
|
|
|
export const addGoatCounter = () => {
|
|
window.goatcounter = {
|
|
path: function (p: any) {
|
|
return location.host + p;
|
|
},
|
|
};
|
|
|
|
let goatcounter = document.createElement("script");
|
|
goatcounter.src = "//ziege.queer-lexikon.net/count.js";
|
|
goatcounter.async = true;
|
|
goatcounter.setAttribute("data-goatcounter", "https://ziege.queer-lexikon.net/count");
|
|
|
|
document.head.appendChild(goatcounter);
|
|
};
|