Skip to Content
Platform.Ontology

navigator.sendBeacon

Sends a small POST that the browser delivers even while the person is leaving the page.

Works without askingTracking across apps and sitesAfter leavingWeb browsersAfter you leave the site

In one line

Can send a small report that the browser delivers even as you leave the page

Sends a small POST that the browser delivers even while the person is leaving the page.

Lets analytics report time on page, scroll depth and exit clicks after the tab is closed or navigated away. No response is readable. The person cannot see or stop it, and it carries cookies for the target origin.

What it can and can't do

What the user does: Nothing. It happens when you close or leave a page

It can

  • Send a small message as the page closes
  • Report time spent, clicks or errors
  • Deliver the message even after the tab is gone

It cannot

  • Send large amounts of data, since there is a size limit
  • Get a reply back to the page
  • Run if a blocker stops the request
  • Show a prompt or any sign

Browser support

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

How a site asks for it

APInavigator.sendBeacon(url, data)
Browser compat keysapi.Navigator.sendBeacon
How access is grantednone
What the user seesNone
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsFire and forget; queued by the browser until sent
How to take it backClear site data, browser privacy settings
Inside an iframeNot listed

Data you get

What comes back: Beacon request
Shape: event
How often: at page exit

FieldTypeUnitRangePrecision
payloadintegerbytesup to about 65536exact

Technical limits

  • About 64 KiB of queued beacon and keepalive data per page (Chrome)
  • POST only, response not readable
  • Returns false if the data is refused
  • Blocked by tracker blockers

The story

What it is

Sends a small message that the browser delivers even as you leave the page.

For you

You never see it. You close a tab or click away, and the page sends a last note that gets delivered. You cannot read it, stop it or know what it held.

For makers

Normal requests are cut off when a page closes. sendBeacon lets analytics finish a report about time on page, scrolls or exits. It is simple, so it is everywhere.

Where you see it

TypeExampleApps
analyticsA news site sends how long you read and how far you scrolled when you leave the article.Google Analytics, Chartbeat
gamesA browser game sends final stats when you close the tab, so the server records your run.None named
videoA video site sends your watch time so it can resume next visit.YouTube, Vimeo
adsAn ad tag reports that an ad was seen for 2 seconds.Google Ad Manager
securityA fraud tool sends last mouse and key data on exit from a checkout page.Sift
developerAn app sends crash and speed data as the tab closes.Sentry, Datadog

Risks

  • Hard to see or stop
  • Carries cookies to the target site

What the platform says

  • Mozilla: sendBeacon. Developer docs describe it as a way to send a small amount of data in the background, even on page exit.

Good uses and abuse

Legitimate uses

  • Exit analytics, error logs

Known abuse

  • Post-visit tracking that survives page close

Scores

ScoreValueMeaning
Sensitivity3 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-11, Chrome 39: Shipped
  • 2018-03, Safari 11.1: Shipped in Safari

Sources

How well checked: Checked against real behavior.

On this page