I've heard Snowplow is good. I think it's self-hosted so it's likely more complicated to setup than a complete solution like Google Analytics. But then Google doesn't get the data.
+1. Not easy to setup if you have little cloud experience, but once you have it running, it works really well. I have a fast setup for the ones who like containers and Kubernetes: https://github.com/pacuna/snowplow-pipeline
https://github.com/snowplow/snowplow
https://github.com/snowplow/snowplow-javascript-tracker