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
New Report: Traffic by Day Of Week (Monday, Tuesday, etc.) #3275
Comments
Attachment: New patch for this issue. |
Added a new patch for this issue. Removed the extra filter in my last patch. Let me know if it's good to commit. |
Ignore the core/DataTable/Filter/Callback.php file in my patch. It's just noise. |
Very nice!
Is this code necessary? Otherwise, looks great, please commit |
Replying to matt:
The code is so addDataTable will work when column values are strings. For this patch, VisitsSummary.get sets bounce_count to 'X%' and not 0, so it won't add the column to an empty row w/o this code. If there's a better way to accomplish this, let me know. Otherwise I'll commit? |
as discussed, it's lacking the Exception for string + string use case, otherwise looks OK! |
(In [6596]) Fixes #3275, add 'Visits by Day of Week' report to VisitTime as related report for 'Visits per local time'. Notes:
|
Thanks for commit, found some issues:
|
(In [6618]) Refs #3275, fix bar graph regression & made exception message in sumRowArray more descriptive. |
Replying to matt:
I can't reproduce this issue... Do you know what report is causing it? Maybe it's due to archiving some report? Though the tests should fail in that case. |
On the demo you can reproduce the issue: I guess it happens if at least 2 days with data on the same week day in the selected period. Also I noticed another bug: ordering of week days works well by default, but when selecting another metric in the metric picker, the days are not ordered anymore, appearing in random order. |
Attachment: Patch to fix bug & show goals info. |
I put up a patch that will fix the bug and show goals related info. What do you think of it? |
Nice try, it looks like it's working but I think this code is too complex, and would require more refactoring for example to re-use the existing Goal summing code in: enrichConversionsByLabelArray() However I don't think we want to do this as it's probably too complicated. Can you please just commit the change to make it work for Months and leave out the Goal icon and metrics? we can revisit later but I don't think it matters too much, and the added code complexity is not worth the benefits here :) |
Replying to matt:
The Months issue is a problem w/ the approach I took. Using VisitsSummary.get & GroupBy means sumRow will be called w/ many string values (which are percents). The only way to get it to work (that I can think of) is to get the metrics by hand. I don't do any summing though... I just move the individual Goal_X_metric metrics into 'goals' => array(X => array(metric => value, ...)) structures. |
Replying to matt:
To clarify, are you ok w/ the changes to AddColumnsProcessedMetrics.php and the use of getDataTableNumeric? Do you mind if I keep the changes to AddColumnsProcessedMetricsGoal.php (even though w/o the goal related code, it won't be used)? If so, I'll commit those changes. |
Actually that function in the filter is already available in: Piwik_ArchiveProcessing::getCoreMetrics() Don't leave the changes in AddColumnsProcessedMetricsGoal since unused code shouldn't be there. I thought some more and the correct way to do this, would be to request the datatable while disabling generic/queued filters. Then you get the raw datatable. Then we would use the core archiving function such as: updateInterestStats() and updateGoalStats() which contains the logic to sum the rows, then we would apply the filters But that will be for later since it's non trivial! |
Replying to matt:
Ok, will commit soon.
I don't think this will work. VisitsSummary.get uses ->filter not ->queueFilter. It could be changed, but I don't think there's a way to disable filters queued on the DataTable, only on the ViewDataTable. Or maybe I'm missing something :) |
(In [6658]) Fixes #3275, fix issue w/ VisitTime.getByDayOfWeek report where sumRow complained of strings being added. |
Reopening, as I have further suggesions to make this new feature more visible and useful!
|
Replying to matt:
I do not think this report should be hidden when period=day :
|
Regarding what should be shown when period=day: Right now, the API will return the report for period=day as it would for any other period. The result will show a bunch of visits for that one day, and 0 visits for the rest. This information is useless, but I don't think it would be a problem to show it |
it's OK to show the widget with period=day and have it show only 1 column of data (for selected day of week), users should understand that it will work when larger date range is selected. |
(In [6680]) Refs #3275, fix build |
(In [6681]) Refs #3275, merge two translations. |
Cool feature :) |
It would be useful to visualize a "Traffic by Day Of Week" graph, that would look at the last 7 * N weeks to create a graph.
Follow up to Benaka patch in #3184
The text was updated successfully, but these errors were encountered: