Can someone help me to know the time between when a person clicks on a button (that opens a window with an external website), until they close it or return to my website?
The aim of this code is to obtain a time to determine if a person has been on a website enough time to perform a certain action.
I have searched in many places in all possible ways and in several languages, but all I find are methods that only work if the open web is yours, and it is not my case:
window.onbeforeunload = function(){
//acción
}
If you can not write me the code, I also use a source to find out or the name of the " method " to use to find information about its use.
Thank you very much