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…

Have you found a solution yet?
I have the same problem that I got strange data for one day while importing, but I haven’t found a solution to just delete everything for this day. :confused:

Did you try with the Invalidate Reports plugin?

Or else you can do it manually via:

I can’t define a specific date when using the plugin. Only last month or longer.

I tried it manually, but nothing happens. :confused:

./console core:invalidate-report-data --dates=2022-04-28,2022-04-29 --sites=2
INFO [2022-05-05 08:43:46] 7116  Invalidating day periods in 2022-04-28,2022-04-29 [segment = ]...
INFO [2022-05-05 08:43:46] 7116  Invalidating week periods in 2022-04-28,2022-04-29 [segment = ]...
INFO [2022-05-05 08:43:46] 7116  Invalidating month periods in 2022-04-28,2022-04-29 [segment = ]...
INFO [2022-05-05 08:43:46] 7116  Invalidating year periods in 2022-04-28,2022-04-29 [segment = ]...

It says this, but the charts won’t change, even after waiting some time (a day or more).

Just to be sure: Are the raw data OK (visits logs), or do you want to reset the reports data (eg. total number of visits, page views, events… on a day)?

My problem is, I imported Data from Google Analytics. There was a problem at Googles site, so I have wrong data → so i believe also the raw data is wrong.
I would like to delete all the data for this one invalid day (and if possible i would like to import some data for this day from a differen matomo-site).

Then Lukas gave yo the solution:

  • First delete raw data thanks to the GDPR tool
  • Then invalidate historical data.

As I don’t know how the GA import works, I don’t know if you’ll be able to get the good data in the future…

Yeah, I tried this already. But same as @fuego it hasn’t done anything to my data :confused:

Did you achieve do delete raw data?
→ In the visit log, you should not have any data for the specified day…