Use beacon for analytics

a few seconds ago

You can use Beacon API if you don’t need the response of the request you made. For example, if you make analytics requests to the server you can use Navigator.sendBeacon()

The beacon request is asynchronously and send as HTTP POST a request containing a small amount of data to a web server.

navigator.sendBeacon('/insights');