All website owners will want to know which pages their users are browsing, what they are clicking etc. Available solutions are too complex and expensive. Sharing a simple clickstream capture javascript which works for most purposes with a server to capture the logs. Detailed walkthrough of the code is also shared here
https://www.adiganguli.com/category/analytics/clickstream/