IP anonymize console command


#1

Hi,

Have you a list of keys for the console command ?
I wish to anonymize ip address and user ids

But not with GUI
With ./console config:set --section=? --key=? --value=?

And impossible to find a list of section/key/value
The " ./console help " does’nt help for this.

How can i get this information ?

Thanks to you


(Lukas Winkler) #2

Hi,

./console config:set is just a helper to change the config.ini.php file, you can’t run any commands with it.

As far as I know, there is no console command, but you can use the API for this:

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


#3

Thanks for your reply,

So maybe i don’t understand how it works.

If i change config.ini.php, does the configuration of Matomo change as well ?
If yes:
if i run: ./console config:set, i change config.ini.php and so i change the configuration of Matomo ?

It’s not like that ?

i can’t run ./console to anonymize ip with the good key/value ?

something like:
./console config:set --section=PrivacyManager --key=anonymize_ip --value=1
(this doesn’t work)


(Fabian Dellwing) #4

Not all options are set via the config.ini.php, but the command is only able to set those.

So an option you would be able to set with this command is maintenance mode: ./console config:set --section=General --key=maintenance_mode --value=1.


#5

" Not all options are set via the config.ini.php "

ok i’m sad now

So i have tested another way:
I directly change the settings in database and it seems to work.

update matomo_option set option_value=1 where option_name=‘PrivacyManager.ipAnonymizerEnabled’

For the context, i have to deploy Matomo with Ansible so GUI is not an option
If you have a better solution, i’m interested

Thanks to all