How do I see historical data for a new Custom Report?
Matomo Cloud: By default, historical data processing is limited to the last 30 days up to the date the report was created. If you need to backfill older data, contact Matomo Support to process this for you. The configuration below does not apply to Matomo Cloud.
Matomo On-Premise: By default, when you create a new custom report, Matomo processes historical data for the last six months (available since Matomo 4). On-premise users can customise these settings by modifying the config.ini.php
file.
On-Premise customisation for historical data processing
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