I'm trying to figure it out this problem, already found similar posts on this site and over the web and most of these responses are to use: unload
event, which I use it right now, but it executes when the user refresh and close the page.
I use the Beacon API to send data to the server inside the unload
event, so that's not a problem.
All I need is send data when the user closes the page.
Does anyone have any idea to acomplish this? Thanks.