how to know when the user is in specific part of the website and when he leaves that part and display the data in the admin dashboard

I want to display for the admin when a user visits a page and when he leaves that page

the page is for example test.test/my-dashboard. and it’s only available for the logged in users. the admin knows to know the time when the user is in that page and the time the user leaves that page.

thanks in advance and excuse my language.