Give publishers access to site statisticsHow to give access to statistics to site owners depending if they self host or not.

    Publishers want access to statistics about traffic and how people are interacting with their publications. Right now that information is only accessible by the seed team in the plausible dashboards that we manage.

    Seed-hosters

      This cohort faces the problem of not having a simple view of their own subdomain/custom domain. Right now, a seed-hoster is a site owner that either has a subdomain or a custom domain hosted in seed. The problem is that everything rendered from the seed gateway (multi tenant architecture) is done under the same domain in terms of statistics. This means that we cannot isolate one (sub)domain and site owners would see everything.

      The solution to it is changing the destination traffic domain (as seen by plausible) on the go. We would insert the perceived hostname by the app (the domain the user is typing) innd use that as the source from analytics.

      This has two problems, One is scalability, which we would need to create one segment in plausible per domain tracked. However this could be a paid service we provide (or they can just self host if they don't want to pay). The other problem is that now we can see all the traffic that goes into our server because we aggregate all the domains under hyper.media (the same for the test server). But if we segment traffic per tracked subdomain we would have to collect global data from multiple sources. Its doable.

    Self-hosters

      For those who self host, they should be able to disable statistics (or enable them) via the installation script. The problem with the plausible (current provider) statistic script is that anyone can claim the site given that the script is installed in that site. This means that if the seed site owner installs the site with the statistics flag enabled (`--traffic-stats`) and forgets, someone can claim that domain and then the real one will see that that domain is taken. Of course we can contact plausible to reset that so that the real owner can view the statistics.
      This solution has the inconvenience of not scaling and privacy loss. This is because even though a site owner self host, the traffic is sent to seed analytics server and then we create a custom view for them.

      The alternative would be to embed a plausible stat server in each self-hosting installation. This would require another docker container although the solution is not straighforward. We could then secure the connection with a password that only the site owner would know. This is also more scalable