Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 462 Bytes

js-beacon-api.md

File metadata and controls

12 lines (8 loc) · 462 Bytes

Send analytics data using the Beacon API

The navigator.sendBeacon() method is intended to be used for sending analytics data to a server.

navigator.sendBeacon("/log", analyticsData);
  • It sends the HTTP POST request asynchronously, with no access to the server response.
  • The request is non-blocking, causing no delay to unload or the next navigation.

See documentation on usage.