Starts tracking Cumulative Layout Shift (CLS) for the current page.
Configuration for tracking layout shifts.
A function to stop tracking CLS.
import { startLayoutShiftTracking } from "datadog-ux-utils/layoutShifts";const stopTracking = startLayoutShiftTracking({ onChange: (cls, entry) => { console.log("CLS updated:", cls, entry); }});// Stop tracking later:stopTracking(); Copy
import { startLayoutShiftTracking } from "datadog-ux-utils/layoutShifts";const stopTracking = startLayoutShiftTracking({ onChange: (cls, entry) => { console.log("CLS updated:", cls, entry); }});// Stop tracking later:stopTracking();
Starts tracking Cumulative Layout Shift (CLS) for the current page.