Skip to Content
Platform.Ontology

Beacons and keepalive requests

Sends data after the person leaves or closes the page, with no prompt.

Works without askingThings a page can doNetwork channelsWeb browsersWhile you use itAfter you leave the site

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

BrowserStatusFirst versionReleasedNote
ChromeSupported392014-11-18None
EdgeSupported142016-08-02None
FirefoxSupported312014-07-22None
SafariSupported11.12018-04-12None
Safari on iPhoneSupported11.32018-03-29All iOS browsers use WebKit
Chrome on AndroidSupported422015-04-15None
Samsung InternetSupported4.02016-03-11None

How a site asks for it

APInavigator.sendBeacon(url, data); fetch(url, {keepalive:true}); fetchLater()
Browser compat keysapi.Navigator.sendBeacon
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsOne request, queued by the browser
How to take it backNothing to revoke (no permission is stored)
Inside an iframeNo iframe flag

Typical flow

  1. Call sendBeacon in pagehide or visibilitychange
  2. Browser queues the POST
  3. 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

TypeExampleApps
analyticsGoogle Analytics sends the final page timing as you close the tab.Google Analytics, Chartbeat
adsAn ad network logs that you viewed an ad for 12 seconds before leaving.Google Ads
videoA streaming player reports your last watched second so playback resumes on another device.YouTube, Netflix
developerAn error tool sends crash details even if the page is closing.Sentry
gamesA browser game saves your score as you close the tab.None named
securityA 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

Good uses and abuse

Legitimate uses

  • Analytics
  • Session end logging

Known abuse

  • Silent data exfil on leave
  • Session replay flush

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2014-08, Chrome 39: sendBeacon ships
  • 2025-04, Chrome 135: fetchLater() ships

Sources

How well checked: Based on official documentation.

On this page