Beacon API
Checking compatibility...
Send analytics data using Beacon API. Learn how to send data before the page is unloaded.
Return Value
The Beacon API returns a boolean value indicating whether the data was successfully queued. Queued, but not delivered. We cannot track the success or failure of the request with this API.
Basic Analytics
This example shows how to send user activity data to your server without blocking the page or slowing down the user experience.
=
=
=
=
=
=
Output
Click Run to see output...
Page Unload Tracking
This example captures when a user is leaving your page and sends final analytics data before they go, ensuring you don't lose important information.
=
=
=
=
=
=
Output
Click Run to see output...