TapCub is live — analytics, insights and live chat, free on one platform
Glossary

What is a web beacon? Pixel beacons vs the Beacon API

A web beacon is a small invisible request that a page or email makes so a server can record a load. Pixel beacons versus the Beacon API, how much one can carry, and where beacons get lost.

Chen Yu Reviewed by Ethan Brooks Also called pixel tag Last updated Nov 17, 2026 Glossary

Quick answer

A web beacon is a small, invisible request that a web page or email makes to a server so the server can record that the content was loaded. It is usually a one-pixel image; the browser's Beacon API (navigator.sendBeacon) does the same job for data sent as a page closes.

Formula: Events per beacon = 65,536 bytes ÷ bytes per event

What is a web beacon?

A web beacon is a small, invisible request that a web page or an email makes to a server so the server can record that the content was loaded. The classic form is a one-pixel transparent image, also called a pixel tag, web bug or clear GIF. When the image loads, the server sees the request and can log the time, the IP address, the browser type and any cookies it set earlier. Nothing appears on screen.

The word has a second meaning in web development. Browsers expose a Beacon API, navigator.sendBeacon(), that fires a one-way request to a server and keeps going even while the page is closing. This page covers both, because most analytics code today uses the second one to do the job the first one started.

One thing this page does not cover: a Bluetooth beacon, the small radio transmitter that shops and museums use to announce their location to phones. The top results for "what is beacon" are mostly about those; the results for "what is a web beacon" are about the tracking technique described here.

Two things people call a beacon

Pixel-style web beaconBeacon API (navigator.sendBeacon)
What it isAn invisible image (or tiny script) the page or email asks the browser to loadA browser function that queues a POST request
Where it runsWeb pages and HTML emailsWeb pages only, in JavaScript
How data travelsIn the image URL's query string, plus whatever cookies the browser attachesIn the request body (a string, a Blob, form data)
Size limitWhatever the URL length allows64 KiB of queued data in total
ResponseThe server returns an image; the page can ignore itNone you can read. It returns true or false
Typical useEmail opens, ad conversions, older analytics tagsTime on page, last-moment analytics events

For the pixel side, including email opens and ad conversion pixels, see tracking pixel. The rest of this page is mostly about the second column, because it is the part that decides whether your last few seconds of data arrive.

What the server actually receives

A beacon is a normal HTTP request, so the server learns what any request reveals and nothing more:

  1. The page or script triggers the request. An <img> tag points at https://collector.example/b.gif?page=/pricing, or JavaScript calls navigator.sendBeacon("https://collector.example/b", data).
  2. The browser sends it. Along with the URL or body, the request carries the usual headers: user agent, referrer and, if the host set one earlier, cookies.
  3. The server logs it. Typical fields are the time, the IP address (many systems truncate or discard it), the user agent and the parameters the sender put in.
  4. The server answers with something trivial, such as an image, or an empty 202 or 204 response. The visitor sees nothing.

A beacon can only report what its sender chose to put in the URL or body, plus what the browser attaches automatically. It cannot read the page. Whether it can recognise a returning visitor depends on whether a cookie or another identifier travels with it, which is why beacons are often paired with cookies. Email beacons do not need cookies at all, which makes them harder to block.

Why last-moment data needs the Beacon API

The hard moment for analytics is the end of a visit: the tab closes, the user taps a link, the phone switches apps. Before the Beacon API, pages tried to hold the browser open long enough to send data: a synchronous XMLHttpRequest, an image created at the last second, or a loop that did nothing. MDN notes that all of these block unloading and slow down the next navigation.

sendBeacon hands the request to the browser to send when it can, without delaying the page. Three rules follow from the specification and MDN:

  • true means queued, not delivered. The function returns true if the browser accepted the data for transfer. It cannot tell you the server received it.
  • Keep the payload small. The total queued data is limited to 64 KiB (65,536 bytes). If the data is over the browser's limit, the call returns false and nothing is sent.
  • Send on visibilitychange, not unload. MDN says the most reliable moment is when the page becomes hidden. The unload event is unreliable, especially on mobile, and is incompatible with the browser's back/forward cache. pagehide has the same reliability problems.

When you need a response, or control over headers, fetch() with keepalive: true also lets a request outlive the page. Its body is limited to 64 KiB as well.

Sizing a beacon: a worked example

Sample data: a page buffers analytics events in memory and sends them when the tab is hidden. Each event serialises to about 280 bytes.

StrategyEvents in the buffer at hidePayloadFits in 64 KiB?
Send everything at the end400400 × 280 = 112,000 bytes = 109.4 KiBNo: the call returns false, all 400 events are lost
Flush every 50 events, send the rest at hideat most 4949 × 280 = 13,720 bytes = 13.4 KiBYes, with 4.8 times headroom (65,536 ÷ 13,720)

The 64 KiB budget holds 234 such events (65,536 ÷ 280 = 234.06), so a visit with more than 234 events cannot be sent in one beacon. The fix is not a smarter beacon but an earlier flush: send during the visit, and keep only a small tail for the exit.

Where beacons get lost

A beacon that never leaves the browser leaves no trace on your server, so the failure looks like missing data rather than an error.

CauseWhat happensHow to tell
A content blocker drops the collector's hostnameThe request is never made; realtime never shows the visitThe network panel shows no request to the collect host
A content security policy's connect-src omits the collect hostBoth sendBeacon and fetch fail, and the page shows no errorSame: no request in the network panel, and the browser console may report a policy violation
Do Not Track or Global Privacy Control is onA script that respects them does not send at allThe script returns before sending anything
The page closed before the request leftNothing retries it if the sender has no queueGaps cluster at exits, such as time on page

Blockers also act on the pixel kind: Wikipedia lists disabling image loading, plain-text email clients and browser extensions as ways users block them. See ad blocker for what blockers do to analytics in general.

Common mistakes

  • Treating true as proof of delivery. It only confirms the browser queued the request. Verify arrival on the server side or in a realtime report.
  • Sending everything at unload. The earlier the flush, the less you lose to an exit that never fires an event.
  • Putting personal data in the URL of a pixel. URLs end up in server logs, proxies and browser history. Send identifiers only when you need them, and keep emails and names out of query strings.
  • Assuming a beacon needs a cookie. It does not. A script can send a beacon with no cookie and no local storage; what it loses is the ability to recognise a returning visitor by cookie. See first-party cookie.
  • Reading a 200, 202 or 204 as "stored". A server can accept a request and still drop the event, so a success status says nothing about what was kept.

Checking beacons in TapCub

Suppose you installed the TapCub script and want to be sure the data really leaves the browser, including the last seconds of a visit.

  1. Know what the script sends. Each pageview is one request to the collect endpoint (the script's origin plus /api/v1/pulse). It prefers navigator.sendBeacon and falls back to fetch with keepalive and no credentials. The first pageview of a page load uses a fetch that can read the response, because the response carries the site config that decides whether to load chat or the identity script.
  2. Know when time on page is sent. On a route change, when the tab hides or when the page closes, if the page was open for more than one second the script sends a __leave event with the duration in milliseconds.
  3. Confirm arrival in Web analytics › Realtime. Open your site; within a few seconds your pageview should appear in the people feed. The collector returns 202 both for stored hits and for dropped ones, so the status code alone does not tell you.
  4. If realtime stays empty, open the browser's network panel. No POST to the collect host means the browser or a blocker stopped it. Allow the script host and the collect host in connect-src (without chat, static.pathclue.com and api.pathclue.com for the Americas region). TapCub does not bypass blockers or Do Not Track.
  5. Remember there is no queue in the browser. The website script does not retry; a hit that did not leave before the page closed is gone. The script itself writes neither a cookie nor local storage.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Chen Yu

Technical Engineer

Focuses on tracking code, SDKs, and API integrations, with practical guidance on implementation checks and troubleshooting.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is the difference between a web beacon and a tracking pixel?

Usually none. Both names describe a tiny invisible image whose loading is logged by a server. "Web beacon" is also used more broadly for any invisible tracking request, including ones sent with the browser's Beacon API.

Is a web beacon the same as a cookie?

No. A cookie is data stored in the browser; a beacon is a request. Beacons are often paired with cookies, which let the server recognise a returning visitor, but a beacon can be sent without any cookie.

Does navigator.sendBeacon guarantee delivery?

No. It returns true when the browser has queued the data, and false if the data is over the limit. Queued data is capped at 64 KiB in total, and blockers or a content security policy can stop the request before it leaves.

Is a web beacon the same as a Bluetooth beacon?

No. A Bluetooth beacon is a small radio transmitter that broadcasts a signal to nearby phones. A web beacon is an HTTP request sent by a page or email.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics