Site AI Auditdi Internet Solutions

How Third-Party Scripts Slow Down Your Website (and Fixes)

21 agosto 20268 min di letturaVelocità del sito
How Third-Party Scripts Slow Down Your Website (and Fixes)

Short answer: Third-party scripts are code loaded from other companies’ servers: analytics, advertising pixels, tag managers, chat widgets, review badges, video and map embeds, consent tools and A/B testing. They slow sites down by adding extra connections, large downloads and main-thread work you cannot optimise directly. The fix is to inventory every script, measure its cost, remove what is not needed, and load the rest later, only on relevant pages, or behind a click with a lightweight placeholder.

When a site owner asks why their site is slow, the answer is surprisingly often “because of things that are not really part of the site”. The theme may be lean and the images optimised, but the page still loads a tag manager that fires eight marketing tags, a chat widget, a heatmap tool, a review carousel and an embedded video player. Each vendor promises its snippet is “lightweight” and “asynchronous”. Together, they can easily outweigh everything the site itself delivers.

Why third-party scripts are expensive

Step 1: Build an inventory

Most organisations do not know exactly which third-party scripts run on their site. Start with a list.

  1. Open the page in Chrome, open DevTools, go to the Network panel and reload.
  2. Use the “Group by domain” or filter options, or sort by domain, to see every external host.
  3. Check your tag manager container and list every tag, its trigger and the pages where it fires.
  4. Look at your theme and plugin settings for integrations: chat, reviews, social feeds, maps, fonts.
  5. For each entry, write down who requested it, what it is used for and whether it is still in use.

This list alone often reveals tags from previous agencies, tools from cancelled subscriptions and duplicate analytics installations.

Step 2: Measure the cost of each script

Not all third parties are equal. Measure before you decide:

Step 3: Remove what is not worth its cost

With the inventory and measurements in hand, have an honest conversation with the people who own each tool:

Removal is the only optimisation that eliminates the cost completely. Everything else just reduces it.

Step 4: Load the rest smarter

Script typeBetter loading approach
AnalyticsAsync, one tool, minimal plugins and features
Advertising and remarketing pixelsOnly after consent, only on relevant pages, via the tag manager
Chat widgetLoad after a delay or on interaction; show a lightweight button first
Video embedsFacade: preview image with play button, load player on click
MapsStatic map image linking to the full map, or load on click
Review and social widgetsLoad below the fold with reserved space, or replace with static content
A/B testingUse only during active tests; prefer server-side testing where possible

Additional techniques:

Tag managers: help and hazard

Tag managers make it easy for marketers to add tools without developers. That is their strength and their risk. A tag manager container can grow for years without anyone reviewing it. Good practices:

Consent and speed go together

In many countries, marketing and analytics tags that set cookies or track visitors need consent before loading. A properly configured consent tool therefore also improves speed for visitors who have not consented, because those scripts do not load. Make sure the consent banner itself is light and does not cause layout shift, and that tags are really blocked until consent, not just hidden.

Questions to ask before adding a new tool

The cheapest third-party script is the one that never gets added. Before a new widget or tag goes live, ask a few simple questions and write the answers next to the tag:

  1. What decision will this tool help us make, and who will look at its data? If nobody can answer, it is not needed yet.
  2. Which pages does it need to run on? “All pages” should be the exception, not the default.
  3. How much does it load? Test it on a staging copy and compare transfer size and blocking time before and after.
  4. Can it load later? Most tools work just as well a few seconds after the page appears.
  5. Does it need consent? If yes, it must not load before the visitor agrees.
  6. When will we review it? Put a date in the calendar, for example at the end of the campaign.

This takes a few minutes per tool and prevents the slow build-up that turns a fast site into a slow one over a couple of years.

Keep an eye on changes

Third-party code changes without warning. A vendor can ship a heavier version of its script tomorrow, and your site becomes slower without anyone on your side touching anything. Regular monitoring of speed metrics is the only way to notice. When a slowdown appears and nothing changed in your own code, check the third parties first.

How Site AI Audit helps

Site AI Audit runs Google PageSpeed for mobile in every check and reports Core Web Vitals, page weight and server response time, so the effect of heavy third-party scripts on INP and loading shows up in the findings with a plain-language fix. Paid plans add re-checks and weekly monitoring, so you can re-test after removing a tag and compare results over time; see the plans.

Related reading

The bottom line

Third-party scripts are often the largest source of slowness on otherwise well-built sites. Make a list, measure each script’s cost, remove what is not earning its place, and load the rest later, on fewer pages or behind a click. Review your tag manager regularly and monitor speed, because vendors change their code without asking you.

FAQ

What counts as a third-party script?

Any script loaded from a domain operated by another company, such as analytics, advertising, chat, reviews, video, maps, fonts, consent tools and tag managers. Scripts you host on your own domain but did not write, such as plugin code, are first-party in the technical sense but can be just as heavy.

Are async third-party scripts harmless?

No. Async prevents a script from blocking HTML parsing, but it still downloads, competes for bandwidth and runs on the main thread. Heavy async scripts can still hurt LCP and INP.

How do I know which third-party script is slowing my site?

Use the third-party summary in Lighthouse and the Performance panel in Chrome DevTools to see time spent per domain. Blocking a domain in DevTools and comparing results shows its impact directly. Test on a throttled mobile profile.

Should I remove Google Tag Manager to speed up my site?

Not necessarily. The tag manager itself is usually modest; the tags inside it cause most of the cost. Clean up the container, use specific triggers and remove unused tags before deciding to drop it.

Do chat widgets hurt page speed?

Many chat widgets load significant JavaScript and several additional requests. Loading the widget after a delay or on the first interaction, with a lightweight button placeholder, usually keeps the feature while greatly reducing its impact on loading.

#Core Web Vitals#JavaScript performance#Mobile performance#Page speed
Controlla il tuo sito — gratis.Cosa correggere sul tuo sito — e da dove iniziare.
Inizia gratis
Internet Solutions

Altro dal nostro team

Realizzati da Internet Solutions. Prova anche gli altri nostri prodotti: ognuno ti fa risparmiare tempo in modo diverso.

internet-solutions.net ↗
Site AI Audit
Panoramica sulla privacy

Questo sito utilizza i cookie per offrirti la migliore esperienza utente possibile. Le informazioni dei cookie sono memorizzate nel tuo browser e svolgono funzioni come riconoscerti quando torni sul nostro sito e aiutare il nostro team a capire quali sezioni del sito trovi più interessanti e utili.