Accurate click accounting is a critical aspect of any campaign. However, traditionally it often came with a high cost to the user experience: the user has to follow one or more HTTP redirects, or is forced to wait for a synchronous logging request to complete before they can navigate to their destination. The
Beacon API addresses these shortcomings:
- Beacon requests are prioritized by the browser to minimize conflict with other time-critical operations, like reacting to user input.
- Beacon requests are guaranteed to be initiated before a page is unloaded and are allowed to run to completion without requiring blocking requests or other techniques that block processing of user input.
In short, Beacon provides a fire-and-forget API that ensures logging requests are queued and completed by the browser, without the need for blocking requests or additional redirects. This allows users to be taken directly to landing pages without waiting on the click account requests to complete, greatly reducing latency.
AdWords recently switched from redirects to the Beacon API to account for some of the ad clicks on Google.com. This resulted in significant latency improvements. For example, for ad clicks pointing to Google Maps pages, the median latency dropped by 250ms and the 90th percentile latency dropped by more than 1,000ms.
You do not need to take any action at this time to benefit from SendBeacon. Chrome, Firefox and Edge all support SendBeacon, accounting for over
72% of worldwide traffic. We are planning to leverage Beacon API in more of our products in the future, and we encourage everyone else to
take it out for a spin.
Posted by Saurabh Mahajan, Leo Sei and Ilya Grigorik