All posts
Web design & development

Third-Party Scripts Are Slowing Your Site: An Audit Method

Third party scripts performance audit: a script inventory template with cost per script, a remove-defer-replace method and habits that stop tag creep.

By Mehdi Hassan9 min read

The short answer

To improve third party scripts performance, inventory every script your site loads, measure each one's size and main-thread time, name an owner and write down what it earns. Then remove what nobody uses, load chat, video and scheduling embeds on interaction, scope tags to the pages that need them, and re-check real-user INP.

Key takeaways

  • Third-party scripts mostly hurt INP, because they compete with your own code for the main thread.
  • Audit one page of each template type, not just the homepage: the heaviest tags live on pricing and demo pages.
  • A script without an owner and a stated purpose is the first thing to remove.
  • Chat widgets, scheduling embeds and video players can load on click instead of on page load.
  • Tag creep is a process problem: make a row in the inventory a condition of adding a tag.

Part of Core Web Vitals Explained for Marketers and Founders

What are third-party scripts and why do they slow a site down?

Third-party scripts are any JavaScript your site loads from another company's servers: analytics, tag managers, chat widgets, heatmaps, A/B testing tools, ad pixels, consent banners and embedded video players. They slow a site down because they compete with your own code for the browser's main thread, and you don't control how big they are or when the vendor changes them.

The damage shows up mostly in Interaction to Next Paint (INP), the responsiveness metric in Google's Core Web Vitals. A chat widget running a long task while a visitor taps your pricing toggle makes the tap feel broken. Scripts that inject banners above the fold can also delay the largest image and push content around.

Modern frameworks don't save you from what you add on top. Field data for Q2 2026 from corewebvitals.io shows only about two-thirds of Next.js sites pass INP, with a median around 236ms. The problem is rarely one script. It's twenty, each added by a different person for a good reason, and none of them ever removed.

How do you audit third party scripts performance on your site?

You audit third party scripts performance by listing every script, measuring what each one costs, and asking who owns it and what it earns. The six steps below take a growth team from "we don't know what's on the site" to a ranked list of what to cut, delay or keep.

  1. Pull the full list

    Record a page load in Chrome DevTools and group requests by domain, or use the third-party summary in the Performance panel. Then export every tag from your tag manager, because many tags fire only after consent or on certain pages. Check templates and CMS embed fields for hard-coded snippets too.

  2. Measure the cost of each script

    For each script, note transfer size, request count and main-thread time from a Performance trace with mobile CPU throttling on. Lighthouse's third-party audits group this by vendor, which saves a lot of manual sorting.

  3. Name an owner

    Put a person's name next to every script. If nobody claims one within a week, it moves to the removal list.

  4. Write down what it earns

    A pixel feeding a paid campaign with live spend earns its place. A heatmap tool nobody has opened since the last redesign doesn't. Be specific: name the report, metric or decision the script feeds.

  5. Decide: remove, delay, replace or keep

    Work through the list in that order. Removal is free speed; delaying is nearly free; replacing takes a project; keeping is the default only for scripts with a named owner and purpose.

  6. Re-measure in the field

    Lab tests show direction. Real-user data in Search Console's Core Web Vitals report or your own monitoring shows whether INP actually moved, usually a few weeks after the change ships.

What should a script inventory template include?

A script inventory is a one-row-per-script sheet that puts performance cost next to business value, so the decision becomes obvious. Keep it in a shared spreadsheet the whole growth team can see, and treat it as the source of truth for what's allowed on the site.

Column

What to record

Example entry

Script and vendor

Product name and the domain it loads from

Live chat widget

Loaded via

Tag manager, hard-coded, CMS embed or app integration

Tag manager

Pages

Where it fires

Every page

Transfer size

Kilobytes from the Network tab

Measured in DevTools

Main-thread time

Milliseconds from a throttled trace

Measured in DevTools

Loading strategy

Blocking, async, defer, after consent or on interaction

Async on page load

Owner

The person accountable for it

Head of sales

What it earns

The metric or decision it feeds

Demo conversations started

Decision and review date

Keep, delay, replace or remove, and when to check again

Load on click, review next quarter

The cost columns come from measurement. The "what it earns" column comes from a conversation, and that's where most scripts fall. In our experience scripts get cut far more often because nobody can fill in that column than because they're the heaviest on the list.

How do you reduce third-party scripts without losing data?

You reduce third-party scripts by removing what nobody uses, delaying what isn't needed at load, and merging tools that do the same job. Many marketing sites can cut a meaningful share of their script cost without losing any data a team actually reads.

  • Remove duplicates. Two analytics tools, a GA4 tag hard-coded in the template and again in the tag manager, or two session-recording tools left over from trials. Duplicate GA4 and Ads tags are also a common cause of broken Consent Mode v2 data.
  • Load on interaction. Chat widgets, scheduling embeds and video players can render as a light placeholder (a button or a poster image) and load the real script when someone clicks.
  • Delay non-critical tags. Heatmaps and retargeting pixels rarely need to run before the page is usable. Fire them after the page settles or after consent.
  • Scope tags to pages. A scheduling widget belongs on the demo page, not on every blog post.
  • Replace heavy tools when the feature you use is a small part of what the script ships.
  • Use your framework's loading controls. Next.js's Script component lets you choose when each script loads. Our guide to next/image, fonts and scripts in Next.js covers the options.

Once the scripts are trimmed, the remaining work is in your own code. Our guide on how to fix INP covers long tasks and event handlers, and the platform-specific fixes for Framer, Webflow and Next.js cover what each builder lets you control.

Which scripts should you keep, delay or remove?

Keep a script when the decision it informs is worth more than the speed it costs; when nobody can say what it informs, remove it. The table shows the decisions we usually reach for common script types on a startup marketing site. Your inventory may say otherwise, and it should win.

Script type

Usual cost profile

Our usual decision

Web analytics

Moderate, runs on every page

Keep one tool, load it once

Tag manager container

Grows with every tag added

Keep, review quarterly

Live chat widget

Often heavy, runs on every page

Load on click, only on key pages

Session recording and heatmaps

Heavy, listens to every interaction

Run as time-boxed studies

Client-side A/B testing

Can delay what visitors see first

Only during a live test

Ad and retargeting pixels

Many small scripts

Keep those tied to active spend

Embedded video player

Heavy player code

Poster image, load on click

Consent banner

Required where you need consent

Keep, choose a light one

Hypothetical example: scoring a chat widget

For example, suppose a SaaS site loads a chat widget on every page, and the Performance trace shows it as the largest block of third-party main-thread time on mobile. The inventory shows the sales lead owns it and that it earns demo conversations, so removal is off the table.

The chat transcripts show almost every conversation starts on the pricing or demo page. The decision: show a static "Chat with us" button on those two pages that loads the widget on click, and drop it from the blog and docs. Sales keeps every conversation that matters, and the pages that don't need chat stop paying for it.

Why does a tag manager make performance worse over time?

A tag manager doesn't slow a site by itself; it slows a site by making it easy for anyone to add scripts without review. Google Tag Manager is a delivery system, and every tag it fires still runs on your visitor's phone. Without rules, a container becomes a record of every campaign and trial the team has ever run.

The fix is process, not a different tool. Use a naming convention, an owner for each tag, a quarterly cleanup and a rule that new tags get an inventory row before they go live. Our guide to Google Tag Manager setup for startups covers the container structure. If you also check PageSpeed scores, read our explainer on PageSpeed Insights scores versus real-user data first, since lab scores swing with script timing.

How do you stop scripts from creeping back?

Scripts creep back because adding a tag takes two minutes and removing one takes a meeting. Stop it with three habits: an inventory that's the single source of truth, a third-party line in your performance targets, and a scheduled review.

  1. Gate new tags. No tag ships without an inventory row, an owner and an end date for trials.
  2. Set a third-party allowance. Agree how much main-thread time third parties may use on key templates, and treat going over it like a failing test.
  3. Review every quarter. Re-measure, re-ask the "what it earns" question and remove anything expired.
  4. Watch field data monthly. A sudden INP drop with no code change is often a vendor shipping a heavier script.

If you'd rather hand the whole job over, our guide to website speed optimization services explains what a good engagement includes and what to ask for.

Frequently asked questions

Does loading scripts with async or defer fix the problem?
Async and defer stop a script from blocking the page from rendering, which helps loading. They don't reduce the work the script does once it runs, so a heavy chat widget loaded with async can still hurt responsiveness when it executes. Loading on interaction, scoping to fewer pages or removing the script are the changes that reduce main-thread cost.
Is server-side tagging worth it for a startup?
Server-side tagging moves some tracking work from the visitor's browser to a server you run, which can reduce the scripts on the page. It adds hosting, setup and maintenance, so it suits teams with significant paid spend and someone to own the setup. For most early-stage sites, removing unused tags and delaying the rest gives more benefit for far less work.
How often should we audit third-party scripts?
Run a full audit once a quarter and a quick check whenever real-user INP drops without a code change. Quarterly is often enough to catch expired trials and campaign pixels, and short enough that the inventory stays accurate. Also audit before and after any redesign or platform migration, because old tags often get copied across without anyone checking them.
Will removing analytics scripts hurt our SEO?
No. Google doesn't use your analytics tags as a ranking signal, so removing duplicate or unused analytics won't affect rankings. The risk is losing data your team relies on, which is why each script needs an owner who confirms what it feeds before it goes. Faster, more responsive pages are a mild benefit for search and a clearer one for visitors.
Can a consent banner slow down my site?
Yes. Some consent tools ship a lot of script and render a large banner that can become the largest element on mobile, delaying the page's main paint. Choose a light tool, make sure it loads early but doesn't block content, and check that tags respect the consent state rather than firing twice. Test both the accepted and declined paths.

· CEO & Design Director

Copywriter, designer and developer, and founder of Designify Studio. Over five years, 60+ projects across 14+ industries, for startups that have raised $300M+.

Want this done for you? Monthly retainer, $6,000.

Your ongoing design and development team, for products that keep shipping. $6,000, per month, flat fee. Book a free 30-minute call to see if it fits.

Schedule Call