matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.87k stars 2.65k forks source link

Add option to only export visible columns (in CSV, JSON, XML, TSV, ...) when clicking export-table #20745

Open atom-box opened 1 year ago

atom-box commented 1 year ago

One or more extra columns are present in the exported version of a table.

I have appended examples below of the table in dashboard and how its export looks, with the extra columns marked in my images.

atom-box commented 1 year ago

First image is the dashboard view, second image is the same table as it looks when exported. (csv, json, xml, tsv all show the same problem)

This were both made

image image

atom-box commented 1 year ago

In demo.matomo.cloud, Matomo >> Behavior >> Pages >> (export as csv)

Seven columns expected: image

~70 columns actually exported in the csv: image

atom-box commented 1 year ago

Here is my Version 4.13.3.

  1. For this UI table: image

  2. The JSON export looks like this. Should these extra rows be present? There is a boolean for Segment: image

  3. The CSV export has one extra column, Metadata: segment. image

michalkleiner commented 1 year ago

Hi @atom-box, thank you for the report. I agree it may not be ideal that there are more columns in the exports than in the report view within the dashboard, some of the extra columns might be identifying how/for what segment/dates etc. were the data collated. At this stage I wouldn't label it as bug as long as the data in the columns that matter is correct. I'll assign this to the product team for a decision whether they want to address this in any way, either through documentation or export configuration etc. From that perspective, I'll mark it as an enhancement to "make the exports match the report view".

Stan-vw commented 1 year ago

@mattab are you aware why we are exporting the extra column? (see screenshots attached above)

sgiehl commented 1 year ago

The exports are imho exporting all available columns in a report. The UI in various cases limits the displayed columns, so the additional columns, that a e.g. needed for calculations, aren't shown. We could maybe adjust the report export overlay to attach the showColumns parameter with the columns that were shown in the report.

mattab commented 1 year ago

Yes it is mostly by design that all columns are exported.

building on what @sgiehl suggests above, maybe we could have yet another checkbox in the "Export data" popover that would read Only export visible columns with a tooltip like When checked, the data export will only include the columns that were already visible in the report. When unchecked, all other columns (other metrics and metadata) will be returned. or similar

Stan-vw commented 1 year ago

I'd probably make it the other way around, so in the default situation we provide what people see. Something like [ ] Extra Columns - Also exports all columns that are used to calculate the metrics seen in the report (include XYZ)

Keeping this open for more community feedback before scheduling a UX change.

atom-box commented 1 year ago

Gentle reminder.

michalkleiner commented 1 year ago

Hi @atom-box, as this is not a bug nor a critical issue, we are not yet sure when we get available capacity to start working on it. Any help from the community is more than welcome and we will gladly review any relevant pull requests! :)