Scheduled Delete Filters for GDPR Tools

We regularly delete visitors via GDPR tools from certain IP ranges.

We can not use the “Global List of Excluded IPs” because these visits will not be recorded at all.

Is there a way to set a filter / cron tab job to delete visitor log entries older than 48 hours AND from a certain IP range?

Any simple idea is welcome.

Edit: How can we delete visitor profiles via GDPR Tools that have visited a particular page/URL pattern?

Hi,

Just as most parts of Matomo, the GDPR tools have an API that allows you to automate its usage:

https://developer.matomo.org/api-reference/reporting-api#PrivacyManager

Thank you for your reply.

I looked at the link and did not get any enlightenment with the term “(visits)” at the end of “PrivacyManager.deleteDataSubjects”.

Anyone can give me an example, if I would like to delete visitors from IP 1.2.3.4 via “PrivacyManager.deleteDataSubjects” as Lukas mentioned.

Thanks.

Hi,

The documentation definitely lets a lot to be desired, but doing what you want to do is definitly possible (after all the GDPR tool UI is doing it). You can take a look at the HTTP requests that are sent to the API there for inspiration.

I can find all Austrian visiters from this API:
https://dev.matomo/index.php?idSite=all&period=range&date=1998-01-01%2Ctoday&module=API&method=Live.getLastVisitsDetails&segment=countryName%3D%3DAustria&filter_limit=401&doNotFetchActions=1&format=JSON2

This will give me a list like this:

[
  {
    "idSite": 1,
    "idVisit": 4972,
...
    ]
  },
...
]

And if you now want to delete this one visit 4972, you can POST to
https://dev.matomo/index.php?module=API&method=PrivacyManager.deleteDataSubjects&filter_limit=-1&format=JSON2&idSite=1&period=month&date=today
with visits[0][idsite]=1&visits[0][idvisit]=4973 as form data.
So you can also delete multiple visits with one request just like the UI tool does.

Thank you. That’s helpful!

I created a github issue about this in case someone wants to volunteer: