Beacons and keepalive requests
Sends data after the person leaves or closes the page, with no prompt.
In one line
Can send data to a server as you leave or close the page
Sends data after the person leaves or closes the page, with no prompt.
A site can finish sending analytics even as the tab closes. It is the standard way for page leave metrics, and the reason tab closing does not stop data from being sent.
What it can and can't do
What the user does: Nothing. It happens when you close the tab, switch away or tap a link.
It can
- Send a small report to its server when you leave
- Save your last scroll spot, a score or a form draft to the server
- Finish a request even as the page shuts
It cannot
- Send large amounts of data; browsers cap each beacon at about 64 KB
- Wait for or use an answer from the server
- Keep going after the browser kills the page
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 39 | 2014-11-18 | None |
| Edge | Supported | 14 | 2016-08-02 | None |
| Firefox | Supported | 31 | 2014-07-22 | None |
| Safari | Supported | 11.1 | 2018-04-12 | None |
| Safari on iPhone | Supported | 11.3 | 2018-03-29 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 42 | 2015-04-15 | None |
| Samsung Internet | Supported | 4.0 | 2016-03-11 | None |
How a site asks for it
| API | navigator.sendBeacon(url, data); fetch(url, {keepalive:true}); fetchLater() |
| Browser compat keys | api.Navigator.sendBeacon |
| How access is granted | none |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| Activation | none |
| How long it lasts | One request, queued by the browser |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | No iframe flag |
Typical flow
- Call sendBeacon in pagehide or visibilitychange
- Browser queues the POST
- Request completes after unload
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- Keepalive in-flight body limit about 64 KiB per origin in Chrome (shared with sendBeacon)
- Response cannot be read
- Use visibilitychange or pagehide, not unload (BFCache)
- fetchLater() ships in Chrome and Edge 135 (not Firefox or Safari) and defers a request until the page is gone; documented quota about 64 KiB per origin and 512 KiB per document
The story
What it is
A page can send a last message to its server as you leave, and you will not notice.
For you
You never see it. When you close a tab, a quiet message may still go out saying how long you stayed, how far you scrolled or whether a video finished.
For makers
It is the standard way to record the end of a visit for analytics, ads and error reports. It matters because regular requests are cancelled when the page closes and those last numbers would be lost.
Where you see it
| Type | Example | Apps |
|---|---|---|
| analytics | Google Analytics sends the final page timing as you close the tab. | Google Analytics, Chartbeat |
| ads | An ad network logs that you viewed an ad for 12 seconds before leaving. | Google Ads |
| video | A streaming player reports your last watched second so playback resumes on another device. | YouTube, Netflix |
| developer | An error tool sends crash details even if the page is closing. | Sentry |
| games | A browser game saves your score as you close the tab. | None named |
| security | A fraud tool records behaviour signals up to the very last moment of a login page visit. | None named |
Risks
- Hidden reporting
- Cannot be easily stopped
What the platform says
- Mozilla: Navigator.sendBeacon(). MDN describes it as a way to send small amounts of data to a server reliably when a page closes.
Good uses and abuse
Legitimate uses
- Analytics
- Session end logging
Known abuse
- Silent data exfil on leave
- Session replay flush
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2014-08, Chrome 39: sendBeacon ships
- 2025-04, Chrome 135: fetchLater() ships
Related capabilities
Related
- Leave-page confirmation (beforeunload). Can show a generic Leave site? warning when you close or leave, after you have interacted
Sources
How well checked: Based on official documentation.