Is there a way to make APM Real User Monitoring (Javascript agent) keep track of how long the user spent on the page?
I am currently using Elasticsearch v7.11.2
I am aware that the time tracking is not in the list of current available features; is there is any way to do it through, for example using Transaction Spans or with pure JS?
RUM mainly returns the following data/metrics:
Time on page is not one of them. Also, there might be other metrics more interesting than time on page, such as average session duration and dwell time.
Since each transaction contains a duration in microseconds...
...you can use well-known JS techniques for detecting when a user lands on a page and when she leaves, and then you can leverage the Transactions API, in order to measure the time taken by a series of events while the user is on your page.