16 lines
481 B
JavaScript
16 lines
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);
|