diff --git a/js/customElements/header.js b/js/customElements/header.js index 0c3622d..338c031 100644 --- a/js/customElements/header.js +++ b/js/customElements/header.js @@ -10,6 +10,7 @@ class Header extends HTMLElement {

${pageTitle}

+
@@ -17,7 +18,7 @@ class Header extends HTMLElement {
- + `; } } diff --git a/js/customElements/matomo.js b/js/customElements/matomo.js new file mode 100644 index 0000000..c344fd8 --- /dev/null +++ b/js/customElements/matomo.js @@ -0,0 +1,16 @@ +class Matomo extends HTMLElement { + constructor() { + super(); + this.generateTrackImg(); + } + async generateTrackImg(){ + let trackURL = await (await fetch("/API/config.php?name=trackURL")).text() + this.innerHTML = ` + + + + `; + } +} + +customElements.define("jl-matomo", Matomo); \ No newline at end of file diff --git a/js/script.js b/js/script.js index 4ae0e95..2f9ab3e 100644 --- a/js/script.js +++ b/js/script.js @@ -15,4 +15,5 @@ require("./customElements/newComment"); require("./customElements/contactMailButton"); require("./customElements/header"); require("./customElements/mainMenu"); -require("./customElements/footer"); \ No newline at end of file +require("./customElements/footer"); +require("./customElements/matomo"); \ No newline at end of file diff --git a/public/API/config.php b/public/API/config.php index 97fe747..379bf62 100644 --- a/public/API/config.php +++ b/public/API/config.php @@ -8,7 +8,7 @@ switch ($configValue){ echo($sitekey); break; case "trackURL": - echo($trackurl); + echo($trackURL); break; default: echo("notFound");