-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 sparklines and stat for Page views, Downloads and Outlinks separately #1454
Comments
It will by useful! |
Very useful indeed, comparing pages such as marsa-alam.htm and standard downloads / clicks is useful. |
Also in the API we should return nb_actions and nb_downloads nb_outlinks nb_hits |
Pretty useful and must have! |
While working on this, I found a tracker bug which was visible in the The test case works as follows (only relevant parts):
Number of actions should be 4 / 6 / 3 / 3 / 0 / 0, since actions are the sum of pageviews, outlinks and downloads. The computed actions are 4 / 6 / 3 / 4 / 1 / 1. This is because the fourth visit starts with The fix is to check whether we are tracking an action and set |
This ticket requires some schema changes: visit_total_(hits|downloads|outlinks) in log_visit. I added them to core/Db/Schema/Myisam.php and created an Update 1.6-rc2.php in core/Updates. This doesn't trigger the updater. What do I have to do? |
To trigger update, change core/Version.php to a new version number, then create the update file for this version number. It will trigger the update. But in this case you dont need new fields in the schema, which creates performance overhead. To process page/downloads/outlinks, there is a simpler way and also that is more efficient. You can get the total number of downloads/oulinks/page views after processing the datatables in: https://github.com/piwik/piwik/blob/master/plugins/Actions/Actions.php#L463 This is similar to what is done in the Referers plugins to process the number of referers from each type (campaign, websites,etc.): https://github.com/piwik/piwik/blob/master/plugins/Referers/Referers.php#L477 |
It sounds good! |
To get the downloads/outlinks/actions sum, for each table, you could do something like
|
Thanks for the feedback. I still think it would be good to add hits/downloads/outlinks to the schema.
These are the reasons why I would stick with this approach. If you're still conviced it would be better another way, I'll refactor. A compromise could be to add another report to the Actions plugin that returns the sums. This would partition related metrics in two reports (the ones we are talking about and the VisitsSummary) but it's still better than loading the Actions report in the VisitsSummary plugin. Nevertheless, I'd stick with counting the hits/downloads/outlinks in the database. |
The performance overhead is because we add 3 fields to the log_visit table, which cause overhead of 8b * N visits. Not much, but log_* tables must stay as small as possible. Of course you are right that it is not ideal because VisitsSummary would then required Actions archives to display all sparklines. I think this limitation is preferred than adding fields to log_visit. The Downloads/outlinks/pages metrics would be aggregated during archiving (as a "numeric" archive). So, for a sparkline of 30 days, the performance is the same as if you would process these metrics in VisitsSummary. Indeed it is important that all metrics are pre-processed. So the array_sum() would be during archiving only (when the datatable have just been processed). Then VisitsSummary controller would call Actions_API::getDownloadsCount for example. Does it sound good? |
How do we add this to the UI? We could just add three more sparklines in the visitors overview or we could introduce some kind of groups in the overview. Any ideas? Also, it would be cool to display pageviews and unique pageviews (same for downloads and outlinks) in one graph. I think we don't need a separate sparkline for the unique metrics, this would probably be too much. |
(In [5386]) refs #1454 fix for tracking of nb_actions: only track pageviews, outlinks and downloads |
(In [5387]) refs #1454 archiving (unique) pageviews, (unique) downloads and (unique) outlinks |
The unit tests don't run on my machine so I can't add the new expected API output. Is this only happening locally or are the tests broken in trunk? |
(In [5388]) refs #1454 adding pageviews, downloads and outlinks to the ui |
[5388] is a first attempt at the UI. I would like to make it similar to row evolution but that's hard to do for 12 metrics... Maybe someone has an idea!? |
(In [5389]) refs #1454 ui improvements |
(In [5390]) refs #1454 ui improvements (this time from the right working copy) |
(In [5391]) refs #1454 ui improvements (revertig 5389) |
In [I commited the updated files from the wrong working copy. The changes are reverted in 5391. The actual UI improvements are in [5390]: I made the visits overview more compact by combining metrics. |
(In [5392]) refs #1454 Updating expected test files after adding few fields in the VisitsSummary output |
Feedback:
|
Regarding backward compatibility: could we manipulate the existing archives to add the new metrics during the update? We would just have to sum the values for all archived action tables and would not need to use the logs. |
Probably doable, but would potentially take a long time to select all archives (potentially thousands) and update it... I think it's OK to leave the old data as it is but just make sure the UI uses Nb_Actions when available, if nb_pageviews is not available for a given day? |
(In [5393]) refs #1454 new action metrics are only accessed by actions plugin, bounce rate fix, changed color of second line chart series, updated expected test files |
(In [5394]) refs #1454 backward compatibility: show nb_actions if finer metrics are not available, german translation |
(In [5395]) refs #1454
|
(In [5396]) refs #1454 making german and english translations consistent |
(In [5399]) Fixing more test refs #1454 |
(In [5406]) refs #1454 different csv encoding on the build server - again |
i added a file to integration/processed by mistake. should it be in svn-ignore? |
(In [5407]) refs #1454 removing mistakenly added processed integration tests |
(In [5409]) refs #1454 report meta data update |
The visitors overview now works without the ugly cross-plugin API calls. It uses the brand new API.get which combines the *.get methods. Also, there is a metrics picker in the visitors overview evolution graph that makes all metrics from VisitsSummary.get and Actions.get selectable. |
Replying to EZdesign:
I think it is in svn-ignore, isn't it? It just wasn't ignored by my git-svn setup. |
(In [5410]) refs #1454 export and dashboard widget fix |
(In [5414]) refs #1454 API.get has no plugin prefix for metrics anymore |
(In [5416]) Fixes #1454
|
(In [5418]) refs #1454 now that API.get shows all metrics by default, we can export the full report when the export icon below the graph is clicked |
To fix a bug I'm having in the PDFReports plugin, I'd like to understand the purpose of the new API.get mentioned in comment:39. Could you elaborate on its rationale? I'm no expert in archiving and data aggregation so don't hesitate to put it in layman's terms. |
@julien: API.get combines the get methods of other plugins (e.g. Actions.get / VisitsSummary.get). You can get the data from the *.get reports in a single report. This makes comparing metrics from different .get methods possible, because the comparison takes place on one report only. The method introduces no additional data, it's just a proxy for the other methods. In PDFReports, you probably don't need to worry about it. |
Thanks for the clarification. PDFReports plugin creation and edit forms use the output of 'API.getReportMetadata' to display the list of available reports. The new API is returned in 'API.getReportMetadata'. It is therefore selectable when creating/editing mail reports. Is this expected ? |
Since the report doesn't contain new data it probably souldn't be selectable in the PDFReports plugin. If you want, take a look at the API output and see for yourself... |
julien, please add an exception to exclude this report from the PDF/Email list. thx! |
Milestone 1.8.x Piwik 1.8.x deleted |
Currently Piwik reports total number of actions, which includes page views, downloads and outlinks.
While this stat is useful, it would also make sense to report specifically about each action, and have a sparkline+stat for each of the following
The text was updated successfully, but these errors were encountered: