Partytown in 2026: Sandbox Third-Party Scripts in a Web Worker and Save Your INP
Move GTM, GA4, and Meta Pixel into a web worker with Partytown. Real INP numbers, framework setup, dataLayer forwarding, and the caveats that break analytics.
Move GTM, GA4, and Meta Pixel into a web worker with Partytown. Real INP numbers, framework setup, dataLayer forwarding, and the caveats that break analytics.
Cross-origin resources report zero for duration, transferSize, and every phase timing unless the server emits Timing-Allow-Origin. Set it correctly on CDN, S3, or your API to unlock full Resource Timing and honest RUM data.
A third-party script facade is a static placeholder that loads no third-party JavaScript until the user interacts with it. In field data, swapping a YouTube iframe for a facade cuts LCP by 40% on mobile 4G. Here is the 2026 pattern for YouTube, Twitter, Maps, and chat widgets.
A passive event listener promises the browser you won't call preventDefault(), so the compositor thread can scroll immediately without waiting for JavaScript. Here's how I audit and fix the third-party offenders that still ship blocking touchstart and wheel handlers in 2026.
Learn how to use the Long Animation Frames (LoAF) API to diagnose and fix slow INP interactions. Covers script attribution, rendering phase breakdowns, third-party impact analysis, and production reporting.