Solution:
Use Google Analytics which is one of most popular traffic tracking tool on the web. First create or sign in to your Analytics account and add the tracking code on your site (two snippets of code onto every page of your website). GA provides individual tracking ID that tells GA to send analytics data to you. On every page of your website you can use tags which you can trigger to send data you choose to google analytics which analyses this data (For example it can be a purchase of ebook, then you know when it was bought, which user bought it and where user was before it).
Remember to take consideration new GDPR regulations when adding this functionality to your website.