Request for Change (RfC)
-
Last week I attended a Matomo training session. Wow. Cool insights. What I learned and what is currently not possible with the Cloudron Matomo app:
-
If you host a Matomo instance for different domains, the Matomo instance should be available through the domain of the website. This means that we need the alias option instead of the redirect option. (matomo.example.org + matomo.example.com)
-
because of filters like uBlock Origin it is better to rename matomo.php and matomo.js to something completely different. I have no idea how we can fulfill this requirement.
-
-
@luckow great tips!
- Are you referring to a multi tenant setup - https://developer.matomo.org/guides/multi-tenants ? In that approach , each of those sites require a separate database. IMO, in that case, it's probably easier to have multiple matomo installations.
- There's a length discussion over at https://github.com/matomo-org/matomo/issues/7364 . Complicated hacky stuff.
-
no. not that complex. matomo has the possibility to have an instance for more than one domain
The only "problem" with this kind of "multi-tenancy" is to prevent counts based on browser default settings. You are looking at domain specific javascripts and if you load something for www.example.io from matomo.example.com, that's a issue.
BTW: it should not be the best idea to call your subdomain as matomo or tracking or add or similar because of uBlockOrigin filter sets.So in a "sharing" community, a matomo instance (let's call it a subdomain for short: mat.), the Cloudron app needs aliases for mat.example.org, mat.example.io, mat.example.cloud, mat.example.com. All point to an instance with a database. Configured with
Manage Measurables
.For your second topic (or mine) I need more links to point you in the right direction
-
@luckow said in Request for Change (RfC):
So in a "sharing" community, a matomo instance (let's call it a subdomain for short: mat.), the Cloudron app needs aliases for mat.example.org, mat.example.io, mat.example.cloud, mat.example.com. All point to an instance with a database. Configured with Manage Measurables.
I guess what I am asking is how do we tell Matomo about the aliases (not the tracked websites/measurables). For example, how does matomo know
mat.example.org
andmat.example.io
are pointing to it ? The reason this is needed is for generating the tracking code underTracking code
in the UI. Or will this always be the primary domain and never any of the aliases? I don't know what implications this has if upstream code only works with primary domain and is not aware of aliases. -
I found https://forum.matomo.org/t/use-apache-server-alias-to-use-the-same-matomo-installation-for-different-web-sites/49744 . Still haven't found any official docs on this. @luckow if you happen to ask this upstream or know someone who knows this first hand, please link here.
-
Ok. For the alias domain(s) we need to add something to the Matomo configuration.
Installation domain was: mat.example.com. The alias domain was: mat.example.org. Without adding anything to the configuration, the mat.example.org showsAfter I added trusted_hosts[] = "mat.example.org" to the configuration file
config/config.ini.php
, everything works as expected. -
This is a FABULOUS found, it makes every website/domain on Cloudron having it’s own analytics domain and it works flawless!!
-