website/js/customElements/matomo.js
2021-04-13 10:46:15 +02:00

16 lines
No EOL
481 B
JavaScript

class Matomo extends HTMLElement {
constructor() {
super();
this.generateTrackImg();
}
async generateTrackImg(){
let trackURL = await (await fetch("/API/config.php?name=trackURL")).text()
this.innerHTML = `
<!-- Matomo Image Tracker-->
<img referrerpolicy="no-referrer-when-downgrade" src="${trackURL}" style="border:0" alt="" />
<!-- End Matomo -->
`;
}
}
customElements.define("jl-matomo", Matomo);