How to Load Chat Widgets and Tags Without Slowing Landing Pages
Measure what each chat widget, pixel and tag costs a landing page in LCP, INP and CLS, then fix load order with async, facades and tag manager cleanup.

On this page
Every paid click that lands on a slow landing page still counts on the spend side of ROAS, and the slowness often comes from the code that measures the click. In the HTTP Archive 2024 Web Almanac, built on its June 2024 crawl, 92% of the pages it analyzed had one or more third parties, and the median for the top million websites was 27 third parties per page. The 2025 edition, from the July 2025 crawl, still found third parties on more than nine in ten pages; the median count of third-party domains fell while third-party requests per page rose. A landing page with a chat widget, four ad pixels, session replay and a tag manager is normal, and each script competes with the hero and the form for the same network and main thread.
The pass marks come from Google's web.dev, which defines good Core Web Vitals as Largest Contentful Paint within 2.5 seconds, Interaction to Next Paint of 200 milliseconds or less and Cumulative Layout Shift of 0.1 or less, judged at the 75th percentile of page loads and segmented across mobile and desktop.
Which Core Web Vital each script hurts
Optimizing third-party scripts for Core Web Vitals performance starts with knowing which metric a given script damages, since the fix differs for each. Google's web.dev guide to tags and tag managers describes three mechanisms:
- LCP. Tags compete for bandwidth during page load, and main-thread blocking can delay the render of the largest element.
- CLS. Tags can delay critical resources before first render, or inject content into the page. On a landing page that usually means a promo bar or chat prompt pushing the form down.
- INP. Script execution competes for the main thread, and the authors write that "we have seen a correlation between the size of tag managers and poorer INP scores."
Testing has one blind spot. The vitals page explains that Lighthouse loads pages without a user and so cannot measure INP. Total Blocking Time is the lab proxy, and field data from real visitors settles the question.
How to measure what each script costs
The method that holds up is subtraction: block one script, reload, compare. In Chrome DevTools, right-click a request in the Network panel and choose Block request. Chrome for Developers documents that this opens the Request conditions drawer with the pattern already blocked, and that a wildcard pattern such as *://example.com covers a whole domain. Throttle CPU and network to mobile settings, then run each state at least three times and take the median, since one run of a tag-heavy page is noisy.
Lighthouse 13 moved the third-party data. In its Chrome for Developers migration notes, the Lighthouse team mapped the old third-party summary audit to a third-parties insight, folded the layout shift and unsized image audits into a CLS culprits insight, and replaced the render-blocking resources audit with a render-blocking insight. Start the inventory from those three.
The inventory has one row per script. The rows below are a hypothetical example of the template filled in:
| Script | Loaded from | Owner | Job | Needed before first interaction? | Metric at risk | Decision |
|---|---|---|---|---|---|---|
| Analytics page view tag | Tag manager, page view trigger | Analytics | Sessions and conversions | Yes | LCP | Keep early, async |
| Second analytics snippet | Hardcoded in the head | Nobody | Duplicate | No | LCP, INP | Remove |
| Ad platform pixel | Custom HTML tag | Paid social | Conversions and audiences | Page view only | INP | Move to a template |
| Chat widget | Hardcoded in the head | Sales | Live chat | No | LCP, INP, CLS | Facade |
| Session replay | Tag manager, page view trigger | CRO | Recordings | No | INP | Window Loaded, tested pages only |
| Ended A/B test script | Hardcoded in the head | Nobody | None | No | LCP | Remove |
Add columns for the median LCP and Total Blocking Time change when each script is blocked. The tag guide recommends labeling every tag with an owner and auditing periodically, because tags tend to accumulate, and a script with no owner is the first candidate to pause.
The loading patterns web.dev documents
Google's web.dev guidance on Core Web Vitals and third-party JavaScript handles chat widgets, analytics scripts and pixels with a small set of loading patterns, applied one script at a time.
async and defer. Both let the browser keep parsing HTML while the script downloads. web.dev explains that an async script runs at the first opportunity after download, in no guaranteed order, and can still block HTML parsing, while a defer script runs in order after parsing finishes and before DOMContentLoaded. Any synchronous third-party script in the head is the first to change. The same page notes that analytics scripts are usually loaded early so no data is missed, and that there are patterns to initialize analytics lazily while keeping early page-load data.
Preconnect, timed. A preconnect hint opens the connection to an origin early. The same page warns that browsers close connections left unused for 10 seconds, so the hint suits origins the page will call soon, such as the chat widget a visitor is hovering over.
Delayed loading. The tag guide is direct: "To avoid impacting page load, fire non-essential tags after Window Loaded." Because the gap between DOM Ready and Window Loaded can be long, it also shows a custom event fired on a timer. Session replay, heatmaps and secondary retargeting pixels usually belong in this group.
Facades for chat widgets and the three metrics
Of the ways to optimize third-party JavaScript, a facade does the most for chat widgets, because one change reaches INP, LCP and CLS. Chrome for Developers defines a facade as "a static element that looks similar to the embedded third-party, but is not functional and therefore much less taxing on the page load," used in place of the third-party content until the user interacts with it. The documented sequence has three steps: render the facade on load, preconnect to the widget's origins on mouseover, and replace the facade with the real widget on click. The same page says chat widgets can use the facade pattern, lists live chat for Intercom, Drift, Help Scout and Facebook Messenger under its recommended facades, and names calibreapp/react-live-chat-loader for them.
All three metrics benefit. The widget's script no longer downloads during load, which leaves bandwidth for the LCP element, and no longer runs on the main thread before anyone wants it, which protects INP. A facade drawn at a fixed size holds its space from first paint, which protects CLS. For the panel that opens after the click, web.dev says layout shifts within 500 milliseconds of user input are not counted toward CLS, and it recommends overlaying late content outside the document flow where that makes sense. A chat panel that opens as an overlay sidesteps the timing question.
Two caveats apply. Facades lack the real widget's full functionality; the documentation's Drift example notes that the chat bubble, with its new-message badge, appears only once the real widget loads. And Lighthouse 13 dropped the facade audit without a replacement. The migration notes say "Ultimately, we would prefer the third-parties improve their offerings rather than work around them." Lighthouse will no longer remind you, so the inventory has to.
Tag manager hygiene
The tag guide is specific about what keeps a container lean:
- Pick the cheapest tag type that does the job. The guide ranks image tags, or pixels, as the most performant, "followed by custom templates, and lastly, custom HTML tags." To inject a script, it recommends a custom template using the
injectScriptAPI. - "Unused tags should be paused or removed rather than blocked through use of a trigger exception." A blocked tag still ships in the container.
- Look for duplicates, such as a tag hardcoded in the HTML and injected again through the tag manager.
- Keep cookie notices, hero images and core site features out of the tag manager, where the guide says they load later and can worsen LCP and CLS.
- Avoid running several containers on one page, which the guide says rarely works well. Google's Tag Manager help says to optimize a container once its Size indicator passes 70%, and the 2021 tag guide put the size limit at 300 KB and the median site container at around 50 KB.
- Consider server-side tagging, which moves vendor code off the client for the tags that support it.
The order of fixes that keeps tracking intact
To improve Core Web Vitals on a landing page with tracking scripts and chat widgets without losing conversion data, change one thing at a time, starting with what nothing depends on:
- Record a baseline: daily conversions as each ad platform and your analytics report them, plus lab and field numbers.
- Remove duplicates and scripts left over from ended tests.
- Keep the tags that must see the landing page view (analytics page views, and any ad platform base tag your attribution relies on) on the page view trigger, loaded async.
- Convert custom HTML tags to templates or image pixels where the vendor supports it.
- Replace the chat widget with a facade.
- Move everything else to Window Loaded or a timed custom event, limited to the pages that use each tag.
- Reserve space with
min-heightoraspect-ratiofor anything still injected into the layout, or render it as an overlay. - Evaluate server-side tagging for the vendors that support it.
After each step, compare platform-reported conversions with the baseline for the same weekdays, so a drop points to one change. Platform counts measure attribution; whether the ads cause the sales is an incrementality question, and a tag change can move the first without touching the second.
A before and after Lighthouse example
Hypothetical example: the page, the numbers and the changes below are illustrative assumptions, and none of it is a client result. Picture a paid search landing page tested in mobile Lighthouse, median of three runs, before and after the eight steps above.
| Lab metric | Before | After |
|---|---|---|
| Largest Contentful Paint | 4.4 s | 2.3 s |
| Total Blocking Time | 870 ms | 210 ms |
| Cumulative Layout Shift | 0.16 | 0.02 |
In this example the LCP gain comes from taking the hardcoded chat widget and the duplicate analytics snippet out of the head, the Total Blocking Time drop from moving session replay and two pixels after Window Loaded, and the CLS fix from a reserved min-height on the promo bar plus an overlay chat panel. The vitals page says lab work that improves Total Blocking Time may improve INP in the field, which is as far as a lab run goes. The 75th percentile of real visits decides whether the page passes.
The payoff lands on the media side. When you scale spend, more clicks hit the same page, and if the faster page converts more of them, CAC falls with no change to bids. The ROAS calculator handles the spend and revenue math, our CRO playbook covers the wider landing page work, and our paid media team can help with the pages behind your campaigns.
Sources
- HTTP Archive: Web Almanac 2024, Third Parties
- HTTP Archive: Web Almanac 2025, Third Parties
- web.dev: Web Vitals
- web.dev: Best practices for tags and tag managers
- Google Tag Manager Help: Get started with Tag Manager
- web.dev: Efficiently load third-party JavaScript
- web.dev: Optimize Cumulative Layout Shift
- Chrome for Developers: DevTools request conditions
- Chrome for Developers: Lighthouse is moving to performance insight audits
- Chrome for Developers: Lazy load third-party resources with facades
