Implemented new matomo setup

This commit is contained in:
2025-07-13 12:57:46 +02:00
parent 4e3c124f55
commit a18e888044
24 changed files with 168 additions and 31 deletions

View File

@@ -1,2 +1,2 @@
# sub filters to integrate matomo tracking code in nginx websites
sub_filter '</body>' '<noscript><p><img src="//matomo.{{primary_domain}}/matomo.php?idsite={{matomo_site_id}}&rec=1" style="border:0;" alt="" /></p></noscript></body>';
sub_filter '</body>' '<noscript><p><img src="//{{ domains | get_domain('web-app-matomo') }}/matomo.php?idsite={{matomo_site_id}}&rec=1" style="border:0;" alt="" /></p></noscript></body>';

View File

@@ -7,7 +7,7 @@ _paq.push(["trackPageView"]);
_paq.push(["trackAllContentImpressions"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u="//{{ domains | get_domain('matomo') }}/";
var u="//{{ domains | get_domain('web-app-matomo') }}/";
_paq.push(["setTrackerUrl", u+"matomo.php"]);
_paq.push(["setSiteId", "{{matomo_site_id}}"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];

View File

@@ -1,4 +1,4 @@
base_domain: "{{ domain | regex_replace('^(?:.*\\.)?(.+\\..+)$', '\\1') }}"
matomo_index_php_url: "{{ domains | get_url('matomo', web_protocol) }}/index.php"
matomo_auth_token: "{{ applications.matomo.credentials.auth_token }}"
matomo_index_php_url: "{{ domains | get_url('web-app-matomo', web_protocol) }}/index.php"
matomo_auth_token: "{{ applications['web-app-matomo'].credentials.auth_token }}"
matomo_verification_url: "{{ matomo_index_php_url }}?module=API&method=SitesManager.getSitesIdFromSiteUrl&url=https://{{ base_domain }}&format=json&token_auth={{ matomo_auth_token }}"