How to Audit Third-Party Scripts for Speed and Privacy
Find every third-party script on a page, see which block rendering and what data they collect, and set a size budget per vendor using HTML or a HAR.

How to Audit Third-Party Scripts for Speed and Privacy
Ask a team how many outside services run on their website and the answer is usually a guess that is too low. Analytics, a tag manager, a consent banner, a chat widget, two or three ad pixels, a video player, a font service, a review widget and an A/B testing tool are typical, and each one was added for a good reason by someone who has since moved on. Together they often weigh more than the site's own code and collect more data than anyone realises. This guide shows how to make an inventory, judge each vendor and keep the total under control.
Start with an inventory
You need two views. The page HTML shows what the page asks for at first: script tags, stylesheets, iframes and tracking pixels, and whether each script is loaded with async or defer or blocks the parser. A HAR file shows everything that actually loaded, including tags that a tag manager injected later, with real sizes and timings.
To record a HAR, open DevTools, go to the Network panel, tick Disable cache, reload the page and wait until it settles. Then export the HAR. Because a HAR can contain cookies, keep it private.
Open the Third-Party Script Risk and Budget Analyzer, paste the HTML or open the HAR, and enter your page URL so your own domain is left out. The tool groups every request by site and guesses the vendor and category.
Judge each vendor on three things
Speed is the first. A script in the head without async or defer stops the page from rendering until it has downloaded and run. Consent managers and old analytics snippets are frequent offenders. Large widgets that load on every page, such as chat, cost main-thread time even when nobody opens them.
Data is the second. Session recording tools capture clicks and keystrokes, so they need masked inputs and consent. Advertising and social pixels share visits with networks that build profiles across sites. Even a font service receives every visitor's IP address. The tool gives each category a risk level with a plain reason, and marks unknown domains for follow-up.
Value is the third, and only you can judge it. For every vendor ask who uses its data, when they last looked, and what would break without it. Tags that nobody can explain are the easiest wins.
Set a budget
A budget turns opinions into a rule. Choose a default size per vendor and a total for all third parties, then override vendors you accept as larger, such as a payment script on checkout. With a HAR loaded, each vendor gets a bar that turns red when it goes over. Budgets work best when someone checks them before a new tag goes live.
Common fixes
Load scripts with async or defer, or move them into the tag manager so they wait for the page. Replace eager video embeds with a lightweight preview image that loads the player on click. Load chat widgets when the visitor scrolls or clicks the chat button. Self-host fonts and small libraries, or at least add integrity hashes to files from public CDNs. Make sure session recording and ad pixels wait for consent where the law requires it. Remove anything that nobody owns.
Keep it current
Export the vendor list as CSV and keep it with your privacy documentation. Repeat the audit after campaigns, redesigns and new marketing tools, because third-party bloat comes back quietly. A page that is fast at launch can lose a second within a year without a single code change by the development team.



