Skip to content
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

allow grouping by dimension in reporting API #6227

Closed
diosmosis opened this issue Sep 16, 2014 · 8 comments
Closed

allow grouping by dimension in reporting API #6227

diosmosis opened this issue Sep 16, 2014 · 8 comments
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@diosmosis
Copy link
Member

This ticket is for allowing some way to specify one or more dimensions that can be used to group metric result. For example, the query: groupBy=city&method=Referrers.getKeywords could result in:

{ // a DataTable\Map
    'Tokyo': [
        {'label' => 'keyword1', 'nb_visits': ...},
        ...
    ],
    'London': [
        {'label' => 'keyword1', 'nb_visits': ...},
        ...
    ],
    ...

To accomplish efficiently this will require changing the archiving code significantly and should wait until it is refactored.

@mattab
Copy link
Member

mattab commented Sep 17, 2014

+1 this is a killer feature indeed! Unfortunately not trivial.

We could start making it work for one level groupBy=city but then we could extend to support several dimensions groupBy=city,country. This would be so powerful!

Note: The beauty of this solution is that it will enable Custom Reports ie. create any combination of dimensions and sub-tables. This is the first step required for #4776 Custom Reports, Pivot table feature for Piwik

@mattab mattab added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. labels Sep 17, 2014
@mattab mattab added this to the Mid term milestone Sep 17, 2014
@diosmosis
Copy link
Member Author

If implemented, perhaps site ID and period can be turned into segments so there is just the segment query. Just an idea that popped into my head, maybe not a good idea, but seems like it would make the API more generic.

@diosmosis
Copy link
Member Author

If implemented efficiently, we can remove 'subtable' archiving code for reports like Referrers.getKeywords and Events.getName, since we can just use a groupBy in archiving. Actions will still need subtables though.

@loopmode
Copy link

this would also allow a fix for #11755, right?

@tsteur
Copy link
Member

tsteur commented Jan 17, 2018

BTW this can be done with Custom Reports. You can create a report via the API and specify by what it should be grouped, then fetch the report...

Learn more about the power of Custom Reports in the user guide: https://piwik.org/docs/custom-reports/ or FAQ: https://piwik.org/faq/custom-reports/

This premium plugin can be purchased here: https://plugins.piwik.org/CustomReports

@diosmosis
Copy link
Member Author

@tsteur if this functionality is provided by a plugin, can this be closed?

@mattab
Copy link
Member

mattab commented Jan 17, 2018

Considered done as it is available in custom reports product: https://piwik.org/docs/custom-reports/

@mattab mattab closed this as completed Jan 17, 2018
@loopmode
Copy link

Too bad this gets closed, as the plugin/product is apparently not free: https://plugins.matomo.org/CustomReports

@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

4 participants