Swan songs: How Fullstory captures sessions that end unexpectedly

This article exists to describe a somewhat esoteric aspect of the Fullstory data capture infrastructure referred to internally as "swan songs". Most customers using Fullstory wouldn't need to know that swan songs exist or how they work, but sometimes understanding how swan songs work can help to explain certain edge cases that our customers may encounter.

A quick primer on how Fullstory data capture works: When an end user session is captured by the Fullstory script, Fullstory starts by capturing event data locally in the browser. Every few seconds, this local event data is packaged up and sent to Fullstory servers in the form of bundles. These bundles are then processed by Fullstory's backend infrastructure into a format that generates the sessions and behavioral insights you see when you log into the Fullstory application.

Occasionally, the Fullstory script will capture event data locally in the browser, but won't be able to send the bundled events to the Fullstory servers immediately. If the user navigates away or closes their tab—which is normal behavior—Fullstory bundles these events together into a "swan song" bundle, that is, a last ditch attempt to send the event data to Fullstory before the page closes. In some instances, the swan song isn't successful, so the data is stored locally in the user's browser, and the next time the user on that particular device visits the customer's site, the Fullstory script will send the swan song data that weren't successfully sent on the user's last visit. These swan song events will be processed and appear as part of the original Fullstory session.

Swan song bundles can be added to a Fullstory session up to 24 hours after the last bundle was captured (that is, near the end of the session). After 24 hours, swan song bundles will be dropped.


Was this article helpful?

Got Questions?

Get in touch with a Fullstory rep, ask the community or check out our developer documentation.