Google Analytics is a hosted service that provides information on the visitors of a website. It is deeply integrated with other Google products such as Search and AdSense. This integration gives it the unique advantage of providing data like search queries and how many people arrived at your website using them.
If you are using Universal Analytics, you will need to migrate to Google Analytics 4 by 2023-07-01 
As a compromise (and to follow european privacy regulations) Google Analytics has a feature to not record the full IP addresses of users: https://support.google.com/analytics/answer/2763052?hl=en
"The IP anonymization feature in Analytics sets the last octet of IPv4 user IP addresses and the last 80 bits of IPv6 addresses to zeros in memory shortly after being sent to the Analytics Collection Network. The full IP address is never written to disk in this case."