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.89k stars 2.65k forks source link

Email Report files alphabetical order should work in all languages, by eg "Report for URL Website - YYYY-MM-DD to YYYY-MM-D2 - $Translated_Date_string" #19122

Open atom-box opened 2 years ago

atom-box commented 2 years ago

A user suggests the following:

Is there a way to fix the filenames for emailed PDF reports? Matomo defaults to the file name of (for example) "Report abc Website - March 18 - April 16, 2022.pdf" but this makes it impossible to list reports chronologically when they are in alphabetical order.

If archiving PDF reports from Matomo, the problem is severe enough that I would classify it as a bug.

Matomo should be using international ISO 8601 dates by default, i.e. "Report for abc Website - 2022-03-18 to 2022-04-16.pdf". Using "Year-Month-Day" allows sorting the archived PDF files chronologically in alphabetical order. The ability to generate custom report titles (such as "Report for abc Website" instead of "Report abc Website") is a much-needed feature for Matomo.

EDIT from matt: proposed to use Report for URL Website - YYYY-MM-DD to YYYY-MM-D2 - $Translated_Date_string so we still have the nice date, but first have the ISO date.

bx80 commented 2 years ago

Currently the same report description is used both for the email subject and the filename.

The report filename is generated in https://github.com/matomo-org/matomo/blob/daef8036293985885dc838faeb1457d7287cdc10/plugins/ScheduledReports/GeneratedReport.php#L103

We could add a config option to choose the date format to use for the report filename, possibly defaulting to ISO 8601. Scheduled reports already have a custom description which should be appended after the 'Report' prefix, a description of 'for abc Website' should result in 'Report for abc Website'

goochj03 commented 1 year ago

Similar request from another customer: "Would it be possible to change the "report period" field? If I could manage the statistical period as a calendar, that would be great, a calendar to customize certain dates"