matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.71k stars 2.62k forks source link

Track visitor preferences with Matomo #18969

Open sjvolkmann opened 2 years ago

sjvolkmann commented 2 years ago

Many websites also have settings for people who are not logged in, such as dark theme or larger font size. It would be useful and helpful if Matomo could summarize their use in statistics.

sgiehl commented 2 years ago

Hi @Killarnee. You can achieve that by using custom dimensions: https://matomo.org/docs/custom-dimensions/

sjvolkmann commented 2 years ago

@sgiehl Thanks, I've tried it, but I think it fits better with the built-in standard metrics like display width. I mean settings like prefers-color-scheme, I don't know if you can track this with JavaScript at all, but it's worth a try.

I would be happy if this idea would be pursued further.

sgiehl commented 2 years ago

@Killarnee Tracking CSS properties with javascript is possible. But it also requires some special css, which can be access by the javascript. E.g. some sort of element that is only visible for certain css media selectors and then check in javascript if it is visible or not. Nevertheless this wont be something we will include in core, but this might be a candidate for an additional plugin.