On Sat, Nov 2, 2024, at 00:54, Jonathan Vollebregt wrote: > On 11/2/24 12:10 AM, Bob Weinand wrote: > > What percentage of users get to the docs through direct links vs > > the home page > > > > That's something you can generally infer from server logs - was the home > > page accessed from that IP right before another page was opened? It's > > not as accurate, but for a general understanding of orders of magnitude > > it's good enough. > > Even better: If we're talking about internal navigation you can check > the referrer header and know for sure, since the docs don't add > rel=noreferrer on links or anything. > > You shouldn't need server logs _or_ client side JS. A lot of this > tracking stuff could be done by just putting down a proxy or shim that > checks request headers. It looks like matomo offers exactly this via > matomo/matomo-php-tracker. > > I second bob's general sentiment: There's no need for client side tracking. >
Further, most (all?) devs I know generally tend to use pi-holes and other tracking blockers. Devs are notoriously hard people to track via client-side analytics. If we went with a client side solution, I would hope that we use a dedicated domain for ingestion so that this tracking can be easily blocked. It will still be blocked, but some people would rather block the entire domain (e.g., go to other mirrors/sites with the documentation) than be tracked. For the case of whether comments are viewed via server-side, you could always load the comments div async once the scroll position goes past a certain point, and inject them into the dom (see: htmx). This has really crappy usability, but works and might create a faster page load for pages with lots of comments. For people not using javascript, a simple button to reload the page with comments (`?comments=1`?) should be enough and provide the desired analytics as well. — Rob