Beaconing in practice — screenshot of nicj.net

Beaconing in practice

This in-depth guide explains how to reliably send telemetry data from the browser, particularly leveraging the .sendBeacon() API for asynchronous metrics transmission. I find it crucial for understanding various beaconing strategies and their implications for data reliability.

Visit nicj.net →

Questions & Answers

What is "Beaconing in Practice" about?
"Beaconing in Practice" is an in-depth guide that details strategies for reliably sending telemetry data from web browsers to a backend. It covers various methods, timing, and common pitfalls associated with data exfiltration for performance, marketing, or general analytics. Devices can send beacon frames at regular intervals to announce their presence. Beacon frames also provide the timing for other functions of the basic service set (BSS).
Who would benefit from reading "Beaconing in Practice"?
This guide is intended for web developers, performance engineers, and anyone building analytics or RUM libraries who needs to ensure reliable collection and transmission of client-side metrics and user interaction data. Devices can send beacon frames at regular intervals to announce their presence. Beacon frames also provide the timing for other functions of the basic service set (BSS).
How does this guide differentiate sendBeacon() from other data transmission methods?
The guide explains sendBeacon() as a specialized API designed for asynchronous, non-blocking data transmission, especially during page unload events, making it more reliable than XMLHttpRequest or <img> for ensuring data delivery without delaying page navigation. Devices can send beacon frames at regular intervals to announce their presence. Beacon frames also provide the timing for other functions of the basic service set (BSS).
When should data be transmitted using beaconing strategies?
Data can be beaconed at various stages, including immediately at script startup for basic logs, after the page load event for RUM metrics, incrementally throughout a page's lifetime for user interactions, or at the end of the page lifecycle to capture final state or before unload. Devices can send beacon frames at regular intervals to announce their presence. Beacon frames also provide the timing for other functions of the basic service set (BSS).
What are the payload considerations when sending beacons?
Beacons can send data via URL query strings or the request body. Query strings have strict browser limits (typically 2KB-8KB), while request bodies offer greater capacity. The guide also discusses payload compression for larger data sets. Devices can send beacon frames at regular intervals to announce their presence. Beacon frames also provide the timing for other functions of the basic service set (BSS).