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
Scheduled reports: do not show "Users" metric when value is zero #6705
Comments
I am not sure how to fix this properly. Is this the Would we handle this in We could fix it in ScheduledReports but this would require a hack specifically for |
…ven site. looking for other solutions as well
We have basically the pretty much same solution in https://github.com/piwik/piwik/compare/6705?expand=1#diff-ce58a897abf6df1abe41055566f151ecR89 for UserId and https://github.com/piwik/plugin-Bandwidth/blob/master/Columns/Bandwidth.php#L91 for Bandwidth. It would be nice to find a universal solution for this. I worked on it by using API\API::get() but it ended in a nested loop. Also with the current solution we always end up in requesting an additional report with Another solution could be following: Edit: This possibly won't work automatically since Dimension != Metric and here we are interested in the metric |
I worked on a proof of concept for the mentioned idea storing entries in the option table during tracking. This has a big disadvantage: If someone clears the option table or if someone only wants to move all Will think of more solutions. |
…s no longer returned in those examples
I couldn't think of any other way to solve this apart from using the metric. We could not do a separate API call for period=month (last 30 days including today would be even better but slower) and just check whether it is zero as requested initially but I still think it would be only an easy hack and not a good solution. |
…iced when handling multiple period dates and period=range
I will stop working on this issue until @mattab is back to discuss further steps. In a chat with @diosmosis we came up with an idea that A problem would be still the detection of |
…ven site. looking for other solutions as well
…s no longer returned in those examples
…iced when handling multiple period dates and period=range
This is an alternative solution to fix this problem. The difference here is that we only do an additional call to VisitsSummary::get if users is 0. The disadvantage is that eg API.getReportMetadata will report that nb_users exist but the API.getProcessedReport might not return it. This already caused some problems while trying to implement it like this as API.getProcessedReport will add all metrics returned by getReportMetadata automatically. So even if we remove nb_users in the API output of VisitsSummary.get it would be still added again. Another disadvantage of this solution is that the code is more fragile as we have to map parameters like $params[0] to idSite, $params[1] to period, ...
…l mergeChildren as it would change the dataTable
The goal of this issue is that in the scheduled reports, when there are zero
Users
tracked in a given period, we should not display theUsers: 0
row in the Visits summary report,Current behavior:
Expected: row
Users
not displayedThe text was updated successfully, but these errors were encountered: