How to delete reports for one day and for one site

I have tried to find some information on how to delete reports for one day and for one siteid. I think its not possible with the console or via the API. Maybe the only way is to “tamper” the database.

Or?

I would appreciate your kind help - thanks!

Hi,

You can delete data using the GDPR tool (and the API of the GDPR tool).

Thanks @Lukas. I start going through GDPR and the API

Hi,

to be honest, GDPR and options in the API is not what I was looking for. I would like to delete all the reports for the one specific day for one specific siteId.

During the migration process something went wrong with importing the logs and as a result, the data in the report is far from the reality. I am trying to fix this problem.

Maybe I should delete reports from the database but I am wondering if it causes some problems.

It is bit surprising that Matomo console do not give an opportunity for deleting reports for one day and for one site…

Hi,

If you only want to delete the report and regenerate it from the raw data, you can use the invalidate command and then run archiving.

Hello!

Sounds a good tip! Thanks :- :slightly_smiling_face:

It could be done, for example, by running the next following command:

./console core:invalidate-report-data --dates=2020-12-09,2020-12-09 --sites=2

…if I want to delete all the reports for the date 2020-12-09 and for the site on id 2

Hi!

I ran the previous command with the arguments --dates=2020-12-09 and --sites=2

It did not do what I expected it should do.

Then I installed a plugin “Invalidate Reports” but there is no way to select just one specific date for deleting the reports.

It surprises me how difficult it is to delete reports for one date…