Third-Party Scripts and Website Speed: What to Cut
Third-party scripts are code from other companies that your page loads: analytics, tag managers, chat widgets, ad networks, fonts, maps, video players, social buttons, and review badges. Each can be useful. Together they are one of the most common reasons small-business websites feel slow.
Why they cost so much
- Each one needs extra network connections and downloads
- Many run JavaScript that competes for the browser's attention, which can hurt interaction speed. See how to improve INP
- They can load other scripts in turn, chaining requests
- You don't control their code or when it changes
- They can shift the layout as they load. See how to fix layout shift
- They may track visitors, which has privacy implications. See privacy policy and cookie banner basics
Step 1: List what you have
Run a speed test or use your browser's developer tools to see requests by domain. Also open your tag manager and list every tag. You may find old trackers from agencies, expired campaigns, or tools you stopped using.
Step 2: Judge each one
For every third-party script ask:
- What does it do for us? Is it essential, helpful, or just nice to have?
- Does anyone use the data or feature?
- What does it cost in speed? Compare page performance with and without it.
- Is there a lighter alternative?
- What are the privacy implications? Does it set cookies or send visitor data to others?
Remove anything that doesn't earn its place.
Step 3: Load what's left more carefully
- Defer or async. Use
deferorasyncso scripts don't block the page. See render-blocking resources explained - Load late. Start chat widgets and non-essential tools after the page is interactive, or on user action, such as clicking a chat button.
- Use facades. Show a lightweight placeholder, like a thumbnail for a video, and load the real thing only on click. See optimizing video and embeds.
- Load only where needed. A map needn't load on every page, only on the contact page. A form script belongs on the form page.
- Self-host when appropriate. Hosting fonts or small scripts yourself can remove connections to other domains, as long as licenses allow and you keep them updated.
- Preconnect carefully to the few domains that are truly critical.
Step 4: Tidy your tag manager
Tag managers make it easy to add things, and to forget them. Review tags regularly, give clear names, remove unused ones, and limit who can publish changes.
Step 5: Set a rule for adding new ones
Before anyone adds a script, ask for a reason and check the speed impact. See performance budgets.
Don't forget the plugins
On a CMS, plugins often load their own scripts on every page. Remove unneeded plugins and check what each adds. See how to speed up a WordPress site.
Keep measuring
Test again after every change. See how to test website speed and how to reduce website load time.
The bottom line
Every third-party script has a price. Keep the ones that clearly earn their place, load them late and sparingly, and delete the rest.