RUM mainly returns the following data/metrics:
- Page load metrics
- Load time of Static Assets (JS, CSS, images, fonts, etc.)
- API requests (XMLHttpRequest and Fetch)
- Single page application navigations
- User interactions (click events that trigger network activity)
- User-centric metrics (Long tasks, FCP, LCP, FID, etc.)
- Page information (URLs visited and referrer)
- Network connection information
- JavaScript errors
- Distributed tracing
- Breakdown 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...
"transaction" : {
"duration" : {
"us" : 17385392
},
...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.