Skip to content
← All articles

Third-party scripts are slowing your site down

That chat widget, those analytics tags, that social proof popup - they're all loading JavaScript that your visitors pay for in load time.

Third-party scripts are slowing your site down

Open your website in Chrome, go to DevTools (F12), click the Network tab, and reload the page. Filter by JS. Count the scripts. Now look at how many of those scripts are from domains that aren't yours.

If the answer is more than five, you have a problem. If it's more than ten, you have a serious problem. And if it's more than twenty, which I come across more often than you'd think, your website's performance is being dictated by companies whose priorities are not the same as yours.

What counts as a third-party script

Any JavaScript loaded from an external domain. Google Analytics, Google Tag Manager, Facebook Pixel, Hotjar, Intercom, Drift, HubSpot tracking, Cookie consent banners (Cookiebot, OneTrust), font services (Google Fonts technically loads CSS but often triggers JS too), social sharing widgets, embedded YouTube or Vimeo players, live chat widgets, review platforms (Trustpilot, Feefo), A/B testing tools (Optimizely, VWO), retargeting pixels (LinkedIn, Twitter, Criteo).

Each one of these loads JavaScript. Each script needs to be downloaded, parsed, compiled, and executed by the browser. Each one contends for the same CPU and network resources that your actual website content needs.

The real cost

How much does each one actually cost you? A typical third-party script adds 50-200KB of JavaScript and takes 100-500ms to execute. That might not sound like much, but it compounds. Ten scripts at 100KB each is a megabyte of JavaScript. Ten scripts at 200ms execution each is two seconds of CPU time, and that's on a decent desktop. On a mid-range phone, it's worse.

Third-party scripts also introduce unpredictability. Your code loads from your server, which you control. Third-party scripts load from servers you don't control. If Intercom's CDN is slow today, your site is slow today. If a Facebook Pixel script has a bug, your site has a bug. You've handed performance control to companies that don't know your site exists.

I audited a client's site recently where removing a single unused marketing tag improved LCP by 400ms. One tag, that wasn't even being used, was costing nearly half a second on every page load.

The tag management trap

Google Tag Manager is supposed to solve this problem by managing all your tags in one place. In practice, it often makes it worse. Because GTM makes it easy to add tags without involving a developer, marketing teams add tags freely. I've seen GTM containers with 40+ tags, many of them remnants of campaigns that ended months ago.

GTM itself also adds overhead. The container script, the tags it loads, and the event listeners it creates all consume resources. A bloated GTM container can easily add 1-2 seconds to page load time.

What to do about it

Audit every third-party script on your site. For each one, ask three questions. Is it still actively used? Is the data it collects actually being looked at and acted on? Is the value it provides worth the performance cost?

Be honest with the third question. That Hotjar recording tool, when was the last time anyone actually watched a session recording? That live chat widget, what percentage of visitors actually use it? If 1% of visitors use the chat and 100% of visitors pay the performance cost, the maths might not support keeping it.

For scripts you keep, consider loading them more efficiently. Defer non-critical scripts so they load after the main content. Use the `async` attribute where appropriate. Consider loading some scripts only on the pages where they're needed, your chat widget doesn't need to load on every page if it's only useful on the contact and pricing pages.

For Google Analytics specifically, consider whether you actually need it. If your primary concern is SEO, Google Search Console gives you search data without any client-side JavaScript. If you need analytics, Plausible and Fathom are privacy-friendly alternatives with scripts under 1KB, compared to Google Analytics' 30KB+.

The conversation with your marketing team

This is often the hardest part. Marketing teams want data, and every tool promises insights. The performance cost is invisible to them. Having a concrete conversation, "this script costs us 300ms of load time and increases bounce rate by X%", makes the trade-off tangible.

If you suspect third-party scripts are hurting your site's performance and want help auditing and optimising, get in touch at [email protected].

Chris Ryan

Chris Ryan

Managing Director

17+ years in full-stack web development, most of it leading teams agency-side across e-commerce, CMS platforms, and bespoke applications. Specialises in infrastructure, system integration, and data privacy, with hands-on experience as a Data Protection Officer. Founded Innatus Digital in 2020 to offer the kind of honest, technically-led partnership that he felt was missing from the agency world.