Use Privileged Script to Bypass Shadow DOM in LWR Sites
With Privileged Script, third-party JavaScript libraries can access
components in LWR sites. An LWR site encapsulates all of its elements in Shadow DOM, which
prevents third-party libraries from interacting with the components. This script lets libraries,
such as Google Analytics and Google Tag Manager, bypass Shadow DOM.
Where: This change applies to LWR sites accessed through Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.

