New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add setting to disable dimensions server side, skip those dimensions … #16609
Conversation
…when tracking, and add test
@diosmosis haven't had a detailed look yet or tried it yet but do you think it is possible to remove a report when a dimension is disabled? Say there is a report "City" with a "City" dimension but this dimension is disabled. I reckon this might be possible to do in Then ideally the widget and report would disappear from the UI. Or maybe better we would render a simple standard view saying "This report was disabled by a super user. To enable it and start tracking this data, please ask a super user to enable this report in ..." |
494b3aa
to
43c37c7
Compare
@tsteur added report disabling + some dimension names + only showing tracked dimensions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I reckon this feature will be quite useful 👍 It's nice to be able to disable things like longitude, latitude etc. I'm expecting though there will be eventually side effects and some hard coding needed later as when any of these 2 dimensions are disabled, then the real time map report won't work but it's likely still shown because we maybe cannot disable it automatically (haven't tested it though, maybe it does work).
-
There are some dimensions that should not be possible to be disabled like
measurable, visitId, last action time, profilable, visitorId, channel type, visit type, fingerprint
. Might also need to check if there are maybe some dimensions that could cause issues or side effects in unexpected reports when they are not tracked. -
userId for example appears twice in the list. Probably
Piwik\Plugins\UserId\Columns\UserId
should not be used as it's not tracking any data? -
To disable the related userId report we may need to change the dimension in the
GetUsers
report toPiwik\Plugins\CoreHome\Columns\UserId
Didn't check if any other dimensions appear multiple times.
- Could we add a list of disabled dimensions (if any) to the system check as
Informational
output? This will help when troubleshooting issues in the future so we can see if some dimensions are disabled when we ask for the system report.
Btw... when selecting a dimension, it always closes directly after just selecting one dimension. Not sure if it can stay open? Not too important for now if it's not easy to do. Also when there are too many selected they aren't all visible but that's fine too for now as it's a general problem of the multi select. Do you think it would be easy to use the single expandable select
ui control similar to in custom reports instead? It would be still a problem that after selecting one metric that it closes but at least it would show all selected dimensions plus supports search etc. see screen
Wonder if we should move this setting to Privacy -> Anonymise data
page or alternatively at least under the Privacy Manager
system settings maybe? It took me actually quite a while to find the setting and only after looking in the code found the setting.
Was thinking ideally it would also remove the dimension from the list of segments but I reckon for now we maybe don't want to do this as it could cause issues with existing segments plus maybe some other issues. I suppose we could always do this later.
In custom reports we could maybe remove any disabled dimension from the list of available dimensions? Would need a PR in the custom report and then it would probably also affect the list of selectable metrics. It can quickly get maybe complicated so we maybe wouldn't need to have this as part of the MVP.
Regarding the UI:
Been thinking about the reports that have disabled dimensions for quite a while. I'm still not 100% sure what to do there but thinking maybe we should show the report after all and instead only add a "footer or no data message" when no data exists something like : The dimension for this report is disabled. If you are wanting to track this data please ask a user with super user access to enable this dimension in the xxx settings.
This way users can maybe still view already tracked data and users won't be as confused when a certain report is not shown. On the other side it would have been nice to be able to disable reports this way but for now not needed as part of MVP I would say.
The only problem is that API consumers like the Matomo Mobile app wouldn't know that such a footer message needs to be shown but this is maybe also not needed as part of MVP. I wonder if eventually we maybe simply add another checkbox to decide whether to show related reports or not.
@mattab if you have any thoughts on this let us know ASAP
This is caused by the following code: https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/CorePluginsAdmin/angularjs/form-field/form-field.directive.js#L102-L108 I'm not sure if it's really needed or even what it's intended purpose was. |
I thought privacy might be a good place as well. Don't really have an opinion on the other UX items, mostly those seem to be about the scope of the issue. |
My main thought is about find any possible issue before people find it themselves (it would save us lots of time if we found any bug proactively). for example: could we create some test to disable all the dimensions using this feature, and track some various data (pageview, event, download, outlinks, with most other dimensions set) and test if tracking+archiving+some APIs still work as expected? (at least one manual test and also some automated tests). |
I can add a system test like this. |
Be good to move it into the privacy manager since it is mostly interesting for privacy reasons to track less data. @diosmosis let me know when all the changes are done and I'll review again |
@tsteur still fixing the tests, but this should be ready for another review |
@diosmosis is this ready for another review? or any questions open? |
@tsteur yes it's ready for a review |
@tsteur yes ready for another review |
Thanks @diosmosis. I started reviewing again and started having these points
But then noticed the feature is not all that useful as I was hoping if we don't also remove the reports from the UI that are disabled. However, removing these reports might cause issues that people don't understand why certain reports are not visible etc. And then these dimensions would still appear in segments etc and for some dimensions we would need to do more hard coding to disable the related reports (like removing real time map if longitude or latitude dimension is disabled). Disabling some dimensions could cause problems eg with fingerprint (when disabling plugins). Disabling referrer url or referrer type could break the correctness of quite a few reports as well and everything is overall not that predictable what would happen when disabling certain dimensions. I should have thought it more through from the beginning as it turns out quite complicated. I reckon overall the feature might not be used that much but could cause more issues (especially in support and troubleshooting bugs etc) that it is not worth proceeding with this for now. As a workaround on On-Premise people still have the possibility to disable certain dimensions by disabling plugins. We might need to roll this feature out for Cloud and On-Premise as well although Matomo isn't really tested much when certain plugins are disabled and it doesn't always work. I'm thinking though overall disabling entire plugins might be more of a solution then this maybe. Thanks for your work on this @diosmosis. For now we will close this PR and also close the related issue as a wontfix. @diosmosis in a new PR can we still keep this change to add a default value to And maybe we could also keep the changes for adding the dimension names like for the plugin dimensions as eg in https://github.com/matomo-org/matomo/pull/16609/files#diff-c025d6a1afc9d0b6ed34a29a2fe6f050da06b16821d05cbb8445781a684ee8f5R23 ? |
@tsteur I guess we'd want to go through and list every dimension that someone might want to disable and see if it is already in its own plugin. I can move the other changes into a new PR. Also I guess I misread the privacymanager change, I moved it to the plugin's settings, not the anonymise data page. |
Thanks for creating the other PR @diosmosis 👍 |
Fixes #15435