On this page
What this issue is
A third-party script is a piece of JavaScript your page loads from a domain you do not control. Examples are analytics, ad pixels, chat widgets, review badges, session recorders, A/B testing tools and font or video embeds.
One or two are normal. The problem starts when they pile up. Old agencies, past campaigns and tested tools leave scripts behind, and nobody removes them. Each one adds download size, work for the browser and another company with access to your visitors' browsers.
Why it costs you leads or sales
Scripts compete with your own content for bandwidth and the browser's main thread (the part that handles taps and clicks). On a phone with a weak connection, a heavy page shows the form late or reacts slowly to taps. Visitors leave before they convert.
There is also risk. Every extra domain is one more place that can fail, expire or be compromised. A script that errors can break the code that runs after it, including your tracking and form handling. Scripts that collect personal data without consent also create compliance exposure.
Example: illustrative load times for the same landing page with 3, 10 and 25 third-party scripts. Your numbers will differ.
- Ad clickVisitor lands on the page
- Scripts loadMany outside files compete for bandwidth
- Form usableAppears late or reacts slowly
- LeadVisitor has already left
A slow, script-heavy page loses visitors before the form is usable.
How to check if your site has it
Open DevTools on your key pages
In Chrome, press F12, open the Network tab, tick Disable cache, and reload. Do this on the landing page, the form page and the checkout.
Filter by domain
Click the Domain column or use the filter box. Look for any domain that is not your own. Click JS to show scripts only.
Group by owner
Note which tool each domain belongs to and who at your company uses it. Anything with no clear owner is a removal candidate.
Check what the tag manager loadsGoogle Tag Manager
In Google Tag Manager, open Tags and look for paused, duplicate or old-campaign tags. Many scripts on the page come from here.
Run a lab test
Run PageSpeed Insights or Lighthouse and read the third-party usage and main-thread time sections to see which scripts cost the most.
| Script type | Question to ask |
|---|---|
| Ad pixels (Meta, TikTok, LinkedIn) | Is a campaign still running on this platform? |
| Heatmaps and session recording | Does anyone look at the reports? |
| Chat widget | Is it staffed and does it load on every page? |
| A/B testing | Is a test live, or is it a leftover? |
| Social and review widgets | Do they need to load on every page? |
| Duplicate analytics | Is the same tag installed twice? |
How to fix it
Remove what has no owner or no use
Delete scripts for ended campaigns, replaced tools and duplicate tags. Remove the tool's account connection too, if you no longer use it.
Load only where needed
A chat widget or review badge rarely needs to be on every page. Restrict it to the pages where it helps.
Delay non-essential scripts
Load heatmaps, chat and social widgets after the page is interactive, for example on a later trigger such as Window Loaded rather than Page View.
Use async or defer
Scripts that block rendering should carry async or defer so the page can draw first.
Keep consent rules intact
Do not remove consent checks to save time. Scripts that need consent should still wait for it.
Review plugins
Many plugins add scripts. Deactivate those you do not use, then check the page again in the Network tab.
Check theme and header settings
Look in your theme's custom code or header and footer injection plugin for old snippets and remove them.
Review installed apps
In Settings > Apps, uninstall apps you do not use. Some leave code behind.
Clean theme code
In Online Store > Themes > Edit code, search theme.liquid for leftover script tags from removed apps. Back up the theme first.
Audit tags
Open Tags, sort by last edited, and pause then delete tags with no owner. Use Preview mode to confirm nothing else breaks.
Change triggers
Move low-priority tags from All Pages on Page View to Window Loaded, or limit them to specific pages.
Publish a version
Name the version clearly, for example Removed unused tags, so you can roll back.
Check custom code
Open Project settings > Custom code and each page's settings, and remove old head and footer scripts.
Review integrations
Remove embed elements for tools you no longer use.
Check tracking code fields
Review the Tracking Code sections in funnel and website settings, plus custom code elements on pages, and remove old scripts.
Review custom code
In Settings > Custom Code, remove old snippets and check Marketing Integrations for tools you no longer use.
Check code injection
Open Settings > Advanced > Code Injection and remove old header and footer snippets. Also check individual page settings.
Defer non-critical scripts
Add defer or async to script tags, and load low-priority tools after the load event as shown in the snippet below.
window.addEventListener('load', function () {
setTimeout(function () {
var s = document.createElement('script');
s.src = 'https://example.com/widget.js';
s.async = true;
document.head.appendChild(s);
}, 2000);
});Before
- Scripts from old campaigns and tools nobody uses
- Same tag installed twice
- Chat and heatmap load on every page at once
After
- Every script has a named owner and a purpose
- Passive tools load after the page is usable
- Widgets only load on pages that need them
How to confirm it's fixed
- Reload key pages with DevTools Network open and count third-party domains again
- Run PageSpeed Insights before and after and compare
- Submit a test lead and confirm the form still works
- Check in GA4 and your ad platforms that conversion events still arrive
- Test the page on a phone over a mobile connection
- Confirm the chat widget and other kept tools still load where intended
How to prevent it happening again
- Keep a simple list of every script, its owner and why it exists
- Require a reason and an owner before anyone adds a new tag
- Review the list every quarter and remove what is unused
- Remove a tool's script when you cancel the tool
- Limit who can publish in your tag manager
- Set a page weight budget and watch it
How FunnelGuard handles this
FunnelGuard detects this issue only partly. A robot visitor runs your real journeys on a schedule and checks page weight. If a page becomes much heavier, for example because new scripts were added, that can show up in that check.
FunnelGuard does not give you a full inventory of every third-party script, tell you which ones are unused, or judge whether each one is safe. It also does not remove anything for you.
To cover the rest by hand, use the DevTools Network method above, review your tag manager, and repeat the audit every quarter. FunnelGuard still helps after a clean-up: it re-runs your journeys and checks tracking hits and form steps, so you notice if removing a script broke something. The Free plan covers 1 site and 2 journeys with daily checks, and no card is needed.
Frequently asked questions
Questions people ask
How many third-party scripts is too many?
There is no fixed number. The test is whether each script has an owner, a purpose and a measurable benefit. If a script has none of these, or if the page is slow on mobile, you have too many.
Why is my website slow because of third-party scripts?
Third-party scripts compete with your own content for bandwidth and the browser's main thread. Each one adds downloads, extra connections and processing work. Heavy ones such as chat widgets, session recorders and A/B testing tools often cost the most.
How do I see which third-party scripts my site loads?
Open Chrome DevTools with F12, go to the Network tab, reload the page and filter by JS. Any domain that is not your own is a third-party script. PageSpeed Insights also lists third-party usage and the time each one takes.
Are third-party scripts a security risk?
Yes, they can be. A script runs with access to the page, so if its provider is compromised or its domain changes hands, that code can affect your visitors. Fewer scripts means fewer places this can happen.
Can I just remove scripts from Google Tag Manager?
Yes, but do it carefully. Pause the tag first, use Preview mode, and confirm conversions still record. Then delete it and publish a clearly named version so you can roll back.
Will removing tracking scripts break my ads?
Only if you remove one that is still in use. Remove tags for ended campaigns and duplicates, keep the ones that record leads and purchases, and check your conversion events afterwards.
Does FunnelGuard detect too many third-party scripts?
Only partly. FunnelGuard checks page weight on your journeys, which can reveal that pages have grown heavier. It does not list every script or decide which are unused, so you still need a manual audit.
Related issues
- OPS-201Third-party script blocking render (single point of failure)Fix guide
- OPS-196Unknown third-party domain appears on checkout pageFix guide
- OPS-199Tag manager container edited by unknown userFix guide
- OPS-205Third-party pixel collecting PII without consentFix guide
- OPS-202Chat widget script failing to loadFix guide
- OPS-207Expired third-party SaaS subscription removing widget (reviews, popups)Fix guide