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.66k stars 2.62k forks source link

Restrict user access to certain segments only #14570

Open jmumby opened 5 years ago

jmumby commented 5 years ago

It would be good to be able to restrict user access to only certain segments. This would be useful for users who want to segment data to certain global regions or business units, while preventing users outside those areas viewing data outside of their own region.

A possible solution would be to disable the all visits option for view users and default to the first available segment. If there are no available segments then all visits becomes available.

mathieuroquefort commented 2 years ago

Hello, We would be very much interested by this option. We have one website for the whole country, and would like to allow the delegates of each region or city to view the data for their area. Is there somethnig we can do to help ?

tsteur commented 2 years ago

@mathieuroquefort you might know this already but generally there's a solution using Roll-Up Reporting see "Solution 1" in https://matomo.org/faq/how-to/faq_35687/ . However, this would only work for newly tracked data. Because the data for each country would then be in a separate site, you could grant access to specific sites/countries using existing functionality in Matomo while also having aggregated reporting data in one or multiple different sites. For example you could group all sites from a continent into a roll-up as well.

If you are after this specific feature, then you could consider developing a custom plugin or create a pull request for Matomo and we would review this.

I'd love to give you a bit more advice but I'm not sure how this would be all managed. I would assume there be:

I haven't thought too much about it, but I think this feature may be quite difficult to implement.

mathieuroquefort commented 2 years ago

Hello @tsteur, Thank you for your answer.

We didn't know this possibility of roll-up reporting. Unfortunately, it is a paid module, and could cost over 700€ /year. It would also require that we change completely our tags, which is quite complicated. Especially, it would require to create all the sites at once. We have 700 local comitees. Not all 700 will ask to have access to their analytics. If only 100 ask for it, we would still nedd to create the 700 sites, just in case.

We will investigate the solution of creating a plugin. But as you said, it could be quite complicated : we would change the credentials. And we have never created any Matomo plugin. Are there other people interested by this functionnality who would work on it with us ? Could someone from Matomo help with it ?

tsteur commented 2 years ago

The cost could be over 600€ /year. Note that any kind of custom development will cost a lot more than that. Just on a side note: If you were to split the tracking into 100 or 700 different sites, Matomo will likely perform better since the data can be separated per site. It's just an FYI.

Indeed all tags would need to be changed to track into a separate site and you wouldn't have historical data for each site which be a problem.

Are there other people interested by this functionnality who would work on it with us ? Could someone from Matomo help with it ?

FYI we have a forum category for plugin development: https://forum.matomo.org/c/plugins-platform/11 We wouldn't be able to help with active development as much but we may be able to answer few specific questions if they come up.