Metrics for measuring user engagement for web applications

Unlike business and e-commerce sites, web applications don't necessarily have an end-goal or target for users to achieve. What are some metrics that can be used to measure how 'engaged' users are with the application? I was thinking if there are known ways for linking together user actions (e.g. button clicks, menu clicks, field input, etc.) or if there are some ways to infer this (e.g. time spent per screen). I believe this is better than putting social media links or provide forums for users to find out this type of information, so I would like to try adding this to the web application.

A quick research on the literature in this area includes some frameworks like the UES, HEARTS and UMUX. However, these describe general concepts and processes behind measuring user experience/engagement but does not mention exactly what is physically measured. It would be good to try and understand what is measured and how it might be relevant to user experience.