Skip to content
All articles

Auditing Third-Party Scripts on Your Own Site

Demola AdebayoNovember 22, 20262 min read10 views

Most sites load more third-party code than anyone on the team can list from memory. Tag managers, analytics, chat widgets, A/B tools, session recorders, payment iframes. Each was added for a reason, none was removed, and the aggregate is a privacy and performance question nobody owns.

The method

Stop reading the source. Source tells you what is declared. The useful question is what is executed, which means loading the page in a browser and watching what it does.

  1. Load the page in a headless browser.
  2. Capture every network request and its host.
  3. Capture console errors, because broken third-party code is both a bug and a sign of an abandoned integration.
  4. Wait long enough. Scripts load late, and a two second capture misses the tag manager's deferred tags.

Group the hosts. Anything not on your own domain is a third party you are trusting with your users' browsers.

What the output tells you

  • Hosts you recognise and can account for.
  • Hosts you do not recognise, which are the interesting ones. They are either a subprocessor nobody documented or a leftover.
  • Errors from third parties, which usually mean a disabled account, a blocked tracker, or a version mismatch.

Run it before and after a deploy and you have a diff of what changed. That is the artefact worth keeping, because third-party creep is invisible in code review: it arrives through a tag manager config, not a pull request.

Where this falls short

It sees what loads on the pages you point it at, from one location, without consent-management interaction. It does not prove compliance with anything, and it will not see scripts that only fire for logged-in users or in a specific geography.

Treat it as a fast, repeatable inventory rather than an audit with legal standing. If you need the latter, you need a dedicated tool and a lawyer, not a workflow.

Why we can run this at all

Because the workflow drives a real browser with network and console capture enabled, rather than fetching HTML. That is a small thing that makes a class of checks possible without a bespoke script.

It is listed here: workflow catalogue.

Share this article