I think a big part of modern analytics is a Javascript component that runs in the browser. Javascript can help you tell crawlers from user agents and repeat clients from large school networks (which all have the same source IP).
If you are not using Javascript, then just parsing Nginx/Caddy/Apache log files will give you the same information: https://github.com/josephernest/TinyAnalytics/blob/master/tr...
Speaking of which, what compact datastore is recommended for this? A RRD?