Building a real inventory of the third-party scripts on a client site
When you take over a site from another developer or agency, ask the client how many third-party scripts it loads. The answer is almost always lower than the truth. Nobody is hiding anything. Scripts pile up over years, a
When you take over a site from another developer or agency, ask the client how many third-party scripts it loads. The answer is almost always lower than the truth. Nobody is hiding anything. Scripts pile up over years, added by different people for different reasons, and nobody ever writes the full list down. Before you can configure cookie consent properly, you need that list. Consent is an inventory problem first and a configuration problem second.
Start from the browser, not the docs
Documentation and handover notes go stale. The request log from a real page load doesn't.
Open a private window, open DevTools → Network, tick "Preserve log", and load the homepage without touching the cookie banner. If there are a lot of requests, filter by domain.
For a quick list of hosts, run this in the console after the page has settled:
[...new Set(
performance.getEntriesByType('resource')
.map(r => new URL(r.name).hostname)
)]
.filter(h => h !== location.hostname)
.sort()
It's a starting point, not the full record. It only sees the current document, so requests made inside iframes are missing. The Network tab, with the log preserved across navigations, remains the source of truth.
Where the scripts come from
Trackers reach a site by at least five routes, and a single site often uses several of them:
- Pasted into template code by a developer years ago, for a campaign that ended long since.
- Configured in a tag manager. Google Tag Manager is the usual one, and "we use GTM" tells you nothing about what is inside the container.
- Bundled with a theme or page builder, sometimes documented and sometimes not.
- Shipped by a plugin or app whose main job has nothing to do with tracking: a review widget, a chat tool, a popup builder. Analytics comes along as a side effect.
- Required by an ad network or affiliate program as a condition of joining. Affiliate pixels are among the most often forgotten.
An audit that only checks "the trackers we know we added" misses whichever of these routes nobody currently on the project set up.
The process, step by step
1. Record the pre-consent baseline. That's the clean-state Network log above. Everything in it loaded before the visitor made any choice.
2. Open the tag manager's debug mode. If the site uses GTM or something similar, preview mode shows exactly which tags fired on a given page. It's the fastest way to see what's configured inside the container, rather than guessing from domains.
3. Cover more than the homepage. Product pages, checkout or conversion pages and blog posts often load different scripts. A review app may only track on product pages, and a conversion pixel may only fire on the thank-you page. A homepage-only audit misses these every time.
4. Go through the plugin or app list. Open the settings of every installed plugin or app and look for an analytics or tracking toggle, including on tools that don't present themselves as trackers. Review apps, popup builders and chat widgets are the ones most often overlooked.
5. Test after Reject. Clear the log, click "Reject", and browse a few pages. A script in the pre-consent list is the obvious finding. A script that keeps sending data after Reject is just as important and gets missed more often. It happens when whatever blocks loading before consent doesn't stop scripts that have already started.
6. Write it down properly. For each entry, record the domain, what it is for, which cookie category it belongs to, and whether it is gated correctly right now. For example:
| Domain | Purpose | Category | Gated correctly? |
|---|---|---|---|
reviews-widget.example |
Review widget, includes its own analytics | Statistics | No: loads on page view |
This table also becomes the source for the cookie policy page. A policy that doesn't match what the site actually loads is a separate problem of its own (see our note on keeping your cookie policy matched to reality).
Make it recurring
The biggest gap we see isn't sites that were never audited. It's sites that were audited once, years ago, and never again. A new app, a new campaign pixel or a theme update can quietly add a tracker at any time, and nothing in those workflows makes anyone re-run the check. If you maintain sites for clients, it's worth scheduling the audit, or at least repeating it after every plugin install, theme update or new marketing campaign.
This article first appeared on the Bannerproof blog. If you'd rather not repeat the Network tab routine by hand, you can get a current list of what a site loads before and after consent with a free scan at bannerproof.app.
Written with AI assistance.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.