I don’t recommend tracking all this data in your database it will ramp up the WU in no time.

What you can do is connect google analytics and retrieve data from there using the Data API

You can also take a look at post hog

The data processing is tricky but page views clicks etc are easy to get