By default, Matomo will accurately track the time spent on all your pages, except the last page view of the visit. The last page view of a visit will always show 0 seconds, as there is no subsequent action to calculate time spent. If a visitor views only one page, the entire visit duration is also recorded as 0 seconds by default.

To measure time spent on the last page view more accurately and improve the accuracy of the Visit duration, you can implement the heartbeat timer feature in the JavaScript Tracking code. Learn more about heartbeat timers in the JavaScript Tracking code guide.

If you prefer to assign a different default visit duration for single-page visits, you can change the default_time_one_page_visit. This will not affect the Time spent on page.