How to anonymize IP logging by google analytics? I'm trying to achieve the implementation of:

gtag('config', 'UA-xxxxxxx-x');


to 

gtag('config', 'UA-xxxxxxx-x', { 'anonymize_ip': true });


How to do this in D7?

I tried to add it to advance options in the google. Looked in some technical documents in ga but do not see how to fill in this field in drupal.
Any suggestion?
You can do that using the google analytics module. Enable the module and go to /admin/config/system/googleanalytics, there put your ga id in the textfield then there is a Privacy vertical tab. In that tab there is this checkbox which says Anonymize visitors IP address