RUM update: lux.js v300
almost 2 years ago by Joseph
22 February 2022
This is considered a major lux.js release and may contain some breaking changes.
Breaking changes
LUX.beaconMode
has been removed.LUX.getDebug()
now returns a different format.
New features
- The pathname of the current page is now tracked.
- JavaScript error tracking can be disabled by setting
LUX.errorTracking = false
. - The maximum number of JavaScript errors tracked per page view can be controlled with
LUX.maxErrors = <number>
. - The maximum measure time can be controlled by setting
LUX.maxMeasureTime = <number>
. After this time, data collection will stop and the beacon will automatically be sent. This can be useful to prevent dynamic content like adverts from affecting your CLS and LCP scores late in the page load. The time is specified in milliseconds, and the default value is60_000
(1 minute).
Improvements
- An
unload
handler is no longer used to track abandoned pages, except in legacy web browsers. Thevisibilitychange
andpagehide
events are used instead. - Developers who implement lux.js into a SPA by using
LUX.auto = false
can now opt-in to abandoned page tracking by settingLUX.sendBeaconOnPageHidden = true
.
Bug fixes
- Calling
LUX.init()
on the initial page load will no longer lose previously-captured data.