website/js/customElements/matomo.js

16 lines
481 B
JavaScript
Raw Normal View History

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);