Nobody sets out to load twelve external services on a five-page website. It happens one request at a time. The ads agency needed a conversion tag. Someone tried a heatmap tool for a month. A LinkedIn campaign came with its own pixel. A review widget went on the home page, an A/B test ran last spring, and analytics got installed twice, once by a plugin and once through a tag manager. Now the speed report says much of the page’s loading time belongs to code from other companies.
The encouraging part is that very little of the fix is technical. Dealing with third-party scripts slowing your website is mostly a matter of asking, for each one, whether anybody still needs it. What follows shows how to list every external script, decide what to do with each, and stop the pile growing back.
Why external scripts cost so much
Your own files are under your control. You can compress them, cache them and decide when they load. A script from another company is different in several ways:
- It lives on someone else’s server. The browser has to open a new connection to that server first, and its speed is not up to you.
- It often loads more scripts. A single tag can fetch a library, then a configuration file, then a tracking image, sometimes from more domains.
- It runs on the same thread as your page. While a tag’s code is running, the browser cannot respond to taps or clicks, which is why heavy tags show up in poor INP results.
- It changes without telling you. The vendor can make their script larger at any time. A site that was fine in January can be slower in June with nothing changed on your side.
- Caching is limited. Vendors often tell browsers to keep their files only briefly, so they can update them, and you cannot override that.
Find every external script on your pages
Start with a full list. You will need three sources, because tags hide in different places.
1. What the browser actually loads
Open a page in a private window, open DevTools and the Network tab, and reload. Add the Domain column if it is not visible (right-click the column headers), then sort by it. Everything not on your own domain is third party. Scroll to the bottom of the page and wait a few seconds, because some tags load late. PageSpeed Insights also groups third-party code by provider in its diagnostics, which is a quick way to see which companies cost the most time.
A waterfall chart makes the timing clearer, showing which external requests start early and how long each takes; reading a GTmetrix waterfall explains how to read one.
2. Inside your tag manager
If you use Google Tag Manager, open the container and list every tag, with its trigger. Paused tags do not load; tags set to fire on “All Pages” load everywhere. If you are not sure how containers, tags and triggers relate, our plain explanation of how Google Tag Manager works covers it.
3. Inside WordPress
Check your theme’s header and footer script fields, any “insert headers and footers” plugin, and plugins that add tracking themselves, such as analytics, pixel, review and popup plugins. This is where duplicates usually turn up.
Build an audit list
Put everything in one table. The columns that matter:
| Script | Added by | Purpose | Still used? | Needed on | Can it wait? |
|---|---|---|---|---|---|
| Analytics | Tag manager | Traffic reports | Yes | All pages | No |
| Ads conversion tag | Agency | Conversion tracking | Yes | All pages for remarketing, or thank-you page only | Partly |
| Heatmap tool | Former marketer | Trial last year | No | – | – |
| Review widget | Theme field | Home page reviews | Yes | Home page | Yes, below the fold |
The rows are only an example. The hardest column is usually “Still used?”. If nobody can say who looks at a tool’s reports, ask before removing it, but do ask. Logins for old tools often belong to people who have left.
Keep, limit, delay or remove
Each script on the list gets one of four decisions.
Remove what nobody uses
Old campaign pixels, trial tools and duplicate installations are pure cost. Removing them is the safest speed gain available, and it usually reduces how much visitor data you are sending to other companies as well. Check for analytics installed twice: it slows the page and can count each page view twice.
Limit tags to the pages that need them
A conversion tag that only needs to record completed enquiries can fire on the thank-you page alone, if you do not use it for remarketing. A booking widget belongs on the booking page. In a tag manager this is a trigger change; in WordPress it may need a script manager or the plugin’s own page settings.
Delay what has no visible job
Heatmaps, session recording, social feeds and similar tools can usually wait until the visitor scrolls or taps. Many optimisation plugins offer a “delay JavaScript” feature for exactly this. Keep analytics and the consent tool out of it: delayed analytics misses visitors who leave without interacting, and a delayed consent tool is no use at all. Chat widgets are a special case with their own options, covered in why chat widgets slow pages.
Keep, but load it well
What remains should load asynchronously, which most modern vendor snippets already do. Moving several tags into one tag manager container can tidy things up, but a tag manager is itself a script, and a container with dozens of tags is not light. Consolidate, then prune.
Three kinds of script that deserve extra care
A/B testing tools. Some ship an “anti-flicker” snippet that hides the whole page until the testing script has decided which version to show. If the testing server is slow, visitors see a blank page for that long. Remove the tool and its snippet as soon as the test ends.
Embeds. YouTube videos, maps and social posts each pull in a lot of code. A placeholder that loads the real embed on click saves most of it; video embeds are covered in YouTube embeds and page speed.
Consent banners. In regions that require consent, a consent tool should run before other tags and block them until the visitor agrees. Set up properly, that means visitors who decline load less code. The banner itself is a third-party script too, so choose one that is light, and check that it does not become the largest element on the first screen of a phone.
Test the cost of a tag before you argue about it
Debates about whether a tool is “worth it” go better with evidence. Chrome lets you see what a page would be like without a particular vendor, without touching the live site. In the Network tab, right-click one of that vendor’s requests and choose the option to block its domain. Then reload the page with throttling set to a mobile profile. Blocked requests show in red, and you can switch the block off again from the same menu.
Compare the load with and without that domain: when the main content appears, how soon the page responds to a tap, and how many requests disappear with it. Run each version a few times, since results vary. If blocking one tool makes a clear difference, you have a concrete reason to limit or delay it. If it makes none, it can stay and you can spend your effort elsewhere. It is also the quickest way to check whether third-party scripts are slowing your website before you change anything for real visitors.
Stop the pile growing back
The audit fixes today. A short rule keeps it fixed: every new script gets an owner, a purpose and an end date written into your audit list before it goes live. Review the list every few months, and test the speed of key pages after any new tag goes in. Where third-party code fits among all the other causes of a slow page is set out in the site speed guide, and the group overview on render-blocking CSS and JavaScript covers the files you host yourself.
Frequently asked questions
Is it safe to remove a tracking pixel I do not recognise?
Not without asking first. Find out which platform it belongs to from its domain, then check with whoever runs your marketing or ads. Removing a pixel that an active campaign relies on stops conversion data and can affect how the ad platform optimises. If nobody claims it, pause it for a while before deleting it.
Does Google Tag Manager make my site faster?
Not by itself. It makes tags easier to manage and remove, which can lead to a faster site. But the container is a script, and every tag inside it still loads its own code. A tidy container with a few well-triggered tags helps; a container holding every tag ever added does not.
Why is my site slower than last month when nothing changed?
Something may have changed outside your site. Vendors update their scripts, and a tag can grow larger or load extra files without notice. Compare the third-party requests in the Network tab with an earlier test if you saved one, and check whether anyone added a tag through the tag manager.
Can I host third-party scripts on my own server to speed them up?
Sometimes, but it is usually not worth it. Many vendors change their scripts often and expect them to load from their servers; a local copy can go out of date and break tracking. Removing, limiting and delaying scripts is safer. Some plugins offer local copies of analytics scripts, which can work if kept updated.
If the list turns out longer than you can untangle, a third-party script audit and clean-up is part of our speed optimisation service. We share what we find as a prioritised list, nothing is removed without your approval, and the pages are re-tested afterwards.
Next in this series: Is Your Live Chat Widget Slowing Your Website?