What works for me is:
- Use ipset to drop all traffic from certain countries (you pick which works best for you)
- Configure fail2ban to 'automagically' drop all IPs requesting .php and wp-admin URLs for a few days
- Integrate Piwik/Matomo's 'referrer spam' blocklist into your list of ignored referrers.
- Use per-site logging and only log .html hits with a static site to see page views.
This approach won't work for everyone and it takes extra sysadmin & Bash scripting skills to achieve, but it works really well with my Jekyll site.
I don't receive much traffic on my personal website but my stats page is public and updates hourly with a cronjob. https://www.tombrossman.com/stats/
Also, pretty good advice in this post, bookmarked it.
I detailed that in a (lengthy) blog post if you're interested: https://arnaudr.io/2020/08/10/goaccess-14-a-detailed-tutoria...
Semi live and super useful without having to use 3rd party services like Google Analytics. The HTML report is self-contained (single file) and thus can easily be shared (or just statically hosted).
This is for a personal site and at some point I realized I cared less about having those very detailed google metrics (which I never checked anyway) than about making my site more responsive and less invasive. I nixed google analytics and haven’t looked back; still have basic metrics thanks to goaccess.