How do I see historical data for a new Custom Report?
When creating a new Custom Report, Matomo will by default process the historical data for the newly created Custom Report for the last 6 months (This feature is only available since Matomo 4).
Please note for Matomo cloud customers the following configurations are not available.
This setting can be changed in your config.ini.php
.
For example to have Matomo automatically process Custom Reports for the last 12 months for new Custom Reports, you can add the following to the config.ini.php
under the [General]
section:
rearchive_reports_in_past_last_n_months = 12
For Custom Reports that you wish to archive even further (For as far back as you'd like or as far back as you have RAW tracking data), you can achieve this without invalidating all of the Matomo reports.
This can be done by using the following Matomo console command (For example archiving all custom reports from June 2020 to today):
./console customreports:archive --date=2020-06-01,today
Additionally, we can add more parameters to the command to only archive specific ID Sites (For reports that may be available in all sites) or to archive only specific reports based on the Custom Report's ID:
./console customreports:archive --date=2020-06-01,today --idsites=X --idreport=Y
Since version 5.0.10 of the CustomReports plugin, there's the additional option of narrowing the archiving of custom reports to specific segments:
./console customreports:archive --date=2020-06-01,today --idsites=X --idreport=Y --segment=Z
If you do need to invalidate report data for custom reports, you can use the following command to invalidate only the Custom Reports data:
./console core:invalidate-report-data --plugin=CustomReports --dates=2021-06-01,today --sites=X