Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Matomo
  3. Request for Change (RfC)

Request for Change (RfC)

Scheduled Pinned Locked Moved Matomo
9 Posts 3 Posters 1.5k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • luckowL Offline
    luckowL Offline
    luckow
    translator
    wrote on last edited by
    #1

    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.

    Pronouns: he/him | Primary language: German

    1 Reply Last reply
    4
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      @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.
      1 Reply Last reply
      0
      • luckowL Offline
        luckowL Offline
        luckow
        translator
        wrote on last edited by
        #3

        no. not that complex. matomo has the possibility to have an instance for more than one domain

        image.png

        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 πŸ™‚

        Pronouns: he/him | Primary language: German

        girishG 1 Reply Last reply
        1
        • luckowL luckow

          no. not that complex. matomo has the possibility to have an instance for more than one domain

          image.png

          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 πŸ™‚

          girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #4

          @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 and mat.example.io are pointing to it ? The reason this is needed is for generating the tracking code under Tracking 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.

          1 Reply Last reply
          1
          • girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • luckowL Offline
              luckowL Offline
              luckow
              translator
              wrote on last edited by
              #6

              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 shows

              image.png

              After I added trusted_hosts[] = "mat.example.org" to the configuration file
              config/config.ini.php, everything works as expected.

              Pronouns: he/him | Primary language: German

              1 Reply Last reply
              3
              • girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #7

                @luckow Ahhhh, I see. So, one must login using the alias domain to see the correct script. That makes sense. Let me test and push.

                1 Reply Last reply
                0
                • girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #8

                  @luckow I have enabled alias domains in the new package.

                  1 Reply Last reply
                  3
                  • imc67I Offline
                    imc67I Offline
                    imc67
                    translator
                    wrote on last edited by
                    #9

                    This is a FABULOUS found, it makes every website/domain on Cloudron having it’s own analytics domain and it works flawless!!

                    1 Reply Last reply
                    3
                    • girishG girish referenced this topic on
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Bookmarks
                    • Search