Summary
Description
Hi Alejandro,
I'm testing Shlink with multiple domains and I already use the multiple domains feature.
Each of my domains/services has its own separate Matomo instance (different Site ID for each).
However, the current Matomo integration in Shlink is global: only one MATOMO_SITE_ID environment variable is supported for the entire instance.
All visits from all domains end up tracked in the same Matomo site.
Current workarounds
- Assign custom tags to every short URL and create segments in each Matomo (manual and not scalable)
- Run separate Shlink instances per domain (loses the benefits of the native multi-domain feature and increases maintenance)
Proposed solution
Add support for a different Matomo Site ID per API key or per domain (preferred).
Possible implementations:
- Add a
matomo_site_id column to the domains table (abstract)
Use case
- Domain
serviceA.com → should send visits to Matomo Site ID 1
- Domain
serviceB.com → should send visits to Matomo Site ID 2
- Domain
serviceC.com → should send visits to Matomo Site ID 3
- …and so on for each additional domain
This would allow each domain/service to have completely isolated analytics in its own Matomo instance without any manual segmentation or filtering.
Summary
Description
Hi Alejandro,
I'm testing Shlink with multiple domains and I already use the multiple domains feature.
Each of my domains/services has its own separate Matomo instance (different Site ID for each).
However, the current Matomo integration in Shlink is global: only one
MATOMO_SITE_IDenvironment variable is supported for the entire instance.All visits from all domains end up tracked in the same Matomo site.
Current workarounds
Proposed solution
Add support for a different Matomo Site ID per API key or per domain (preferred).
Possible implementations:
matomo_site_idcolumn to thedomainstable (abstract)Use case
serviceA.com→ should send visits to Matomo Site ID 1serviceB.com→ should send visits to Matomo Site ID 2serviceC.com→ should send visits to Matomo Site ID 3This would allow each domain/service to have completely isolated analytics in its own Matomo instance without any manual segmentation or filtering.