Shahin

JavaScript Library

Beginner
Updated Jul 11, 2026 Shahin editorial 2 min read
PronunciationEN/ˈdʒɑːvəˌskrɪpt ˈlaɪˌbrɛri/

In analytics, a JavaScript library is the browser-side code a site loads in order to record user behaviour and send it to a collection server.

In general usage a JavaScript library means any reusable code package such as React or lodash; in analytics vocabulary it means the web tracking library specifically. It is normally loaded asynchronously from a short snippet, queues calls made before it finished loading, and sends data in batches so the page stays fast. The point where data is most often lost is page unload, so the library must flush its remaining queue with a transport that survives the tab closing.

FAQ

Sources:MDN — Navigator.sendBeacon()