I recommend Piwik Pro for web analytics. It is by far the best UA replacement as it's pretty much cloned it's functionality (and added new ones like custom dashboards). It's a spin off from matomo that has moved more enterprise and serves some very large privacy centric EU companies and institutions.
It's got a generous free tier, but costs a bit if you go over 500k events a month.
It's built on clickhouse, while matomo is built on MySQL which in my opinion is pretty much a nail in the coffin for Matomo's future proofing. Matomo is fine for simple analytics needs but it sucks for tracking sites with custom events with custom dimensions.