Google's John Mueller felt the need to explain on Twitter that there is no penalty for using or not using Google Analytics on your web site. Google doesn't rank a web site any better or worse because you use or don't use Google Analytics.
Here is John's tweet:
Just to be clear: there's no penalty for using or not using GA with regards to search.
— John ☆.o(≧▽≦)o.☆ (@JohnMu) June 28, 2018
He did add that it does help uncover information about your web site and gives you insights into making your web site better:
GA can give you lots of insights about your site & how users enjoy it, but it's not required for search.
— John ☆.o(≧▽≦)o.☆ (@JohnMu) June 28, 2018
But having the Google Analytics snippet in your HTML doesn't give you a ranking boost or ranking decline.
Forum discussion at Twitter.