NGINX Matomo Tracking RoleΒΆ
DescriptionΒΆ
This Ansible role automates the integration of Matomo tracking code into NGINX-served websites. It simplifies the process of adding the Matomo analytics tracking script and image tracker to all your web pages served through NGINX.
OverviewΒΆ
This role injects Matomo analytics tracking code and noscript image tracker into Nginx-served HTML pages.
CosmosΒΆ
The diagram places NGINX Matomo Tracking Role in the Infinito.Nexus cosmos: the components it deploys (capabilities), the central services it consumes (dependencies), and its outward reach (federation and bridged external networks).
flowchart LR
subgraph role [sys-front-inj-matomo π»]
svc_matomo["matomo"]
end
Solid 1:1 edges are fixed relationships; dashed 0..1 edges are conditional (enabled only in matching deployments); red 0..0 edges are turned off in this role. Node markers show the roleβs deploy modes (π» host, π³ compose, π swarm); β marks a service that is explicitly turned off, and βοΈ an Ansible role dependency declared in meta/main.yml.
FeaturesΒΆ
Automated insertion of Matomo tracking script into the
</head>tag of HTML pages.Integration of a noscript image tracker before the
</body>tag for tracking users with JavaScript disabled.Configuration to apply changes on every request, ensuring that dynamic content and single-page applications are also tracked.
RequirementsΒΆ
NGINX installed on the target server.
Matomo analytics platform set up and accessible.
DependenciesΒΆ
None. This role is designed to be included in NGINX server block configurations.
CustomizationΒΆ
You can customize the tracking script and the noscript image tracker by editing the matomo-tracking.js.j2 and matomo.subfilter.conf.j2 templates.
CreditsΒΆ
Implemented by Kevin Veen-Birkenbach. Part of the Infinito.Nexus Project and maintained by Kevin Veen-Birkenbach. Licensed under the Infinito.Nexus Community License (Non-Commercial).