Replacing User IDs with a constant textstring?

Is it possible to anonymize a number of previously tracked user by replacing their User IDs with a textstring (“SecretUser”).
(The CMS will also set the User ID delivered to Matomo to “SecretUser” for these users…)

Do you want to anonymize some or all user IDs ?

Just the ones who whishes to be forgotten…

Be careful, in this case all users who are identified as SecretUser will share the same user ID in the point of view of Matomo… For this case (tracking of users who want to be anonymized), it is better to not provide user ID at all… Matomo will then manage their anonymization.

If I am not wrong, Matomo can delete some visits (then the user who did all these visits), it can anonymize some field of visits on some site and timeframe, but not anonymize on other criteria after the tracking has been done. Maybe you can create such feature request in the GitHub repo:

For your problem, you may set the user_id to NULL and set profilable to 0 in table log_visit for users you want to anonymize. Then invalidate archive data to allow Matomo rebuild the archive data used by reports (including the User ID report).