ScriptSpy – Third-Party Script Intelligence
Detect every third-party script loading on your site, identify owners, data collected, and export a GDPR audit report your lawyer can use.
Install in
ScriptSpy is a focused script intelligence dashboard. It is not a cookie banner and not a consent wizard — those tools already exist. ScriptSpy answers one question:
“What is loading on my site, who owns it, what data does it collect, and give me a PDF I can show my lawyer.”
Two-layer detection
- Server-side scan — fetches your own pages with
wp_remote_getand parses HTML withDOMDocumentto extract every external script, iframe, preconnect hint, and tracking pixel. Catches statically loaded scripts. - Browser beacon — a JavaScript beacon you can run in a real browser (logged-in admin or anonymous via signed token URL). Uses
PerformanceObserver,MutationObserver, and interceptsfetch,XMLHttpRequest, andnavigator.sendBeaconto capture every dynamically loaded resource — including pixels that Google Tag Manager loads after page render.
What you get
- Live dashboard with summary cards: total scripts, known/identified, require consent, unrecognized
- Per-script detail modal: owner, country, data collected, legal basis, GDPR relevance, data transfer destination, Schrems II notes, links to privacy policy and DPA
- PDF audit report (cover, executive summary, full inventory, unknown scripts list)
- CSV export
- Cookie + localStorage detection
- Scan history with diff between scans (added/removed scripts)
- Optional weekly/monthly automated scans with email reports
- Knowledge base of 70+ third-party services (Google Analytics, Meta Pixel, TikTok, Hotjar, Stripe, Intercom, etc.)
Anonymous beacon mode
GTM rules often suppress pixels for logged-in WordPress administrators. ScriptSpy generates a tokenized scan URL you can open in incognito to capture those pixels — without exposing the beacon to your real visitors.
Privacy
ScriptSpy makes no external HTTP requests except scanning your own site. No telemetry, no phone-home, no third-party API calls. The bundled knowledge base is a static JSON file shipped with the plugin.
Written by Joobi from the project's own listing. See the source page
1.0.3
- Fixed: on sites whose timezone is behind UTC, browser beacon data was rejected as soon as the server scan finished, so GTM-loaded scripts were never recorded.
- Fixed: same-site relative URLs,
about:blankframes andjavascript:URLs were counted as unrecognized third-party scripts. - Fixed: long URLs were cut off at the right edge of the PDF.
- Fixed: with plain permalinks the PDF and CSV links returned 404 and the beacon kept reporting its own requests.
- Fixed: the executive summary left out services that transfer data to the EU and another region (
EU/USA). - Fixed: the dashboard kept polling forever after a server-only scan and reset the category filter every two seconds; a JavaScript error on the Settings tab is gone.
- Fixed: “Exclude domains” matched any URL containing the text (excluding
x.comalso removedwix.com); it now matches the domain and its subdomains. - Fixed: a script found by the beacon first and the server scan second was not marked as detected by both.
- Privacy: page URLs reported by the beacon no longer include the scan token, and personal data in their query strings is redacted.
- Hardened: the beacon endpoint checks the scan token in its permission callback, pages served to a scan-token visitor are marked uncacheable, and SSL verification is no longer skipped for
.devsites. - New: deleting the plugin removes its tables, settings and scheduled events.
- Tested with WordPress 7.2 and PHP 8.6.
1.0.2
- Fixed: inline-detected scripts (Google Analytics, Meta Pixel, Intercom and others recognised from inline snippets) showed a knowledge base id where the domain belongs. They are now labelled “inline script”.
- Fixed: the Google Analytics 4 measurement endpoint (
/g/collect) was not in the knowledge base, so GA4 traffic captured by the browser beacon was counted as unrecognized. - Fixed: long privacy policy and page URLs overlapped the following line in the PDF script inventory.
- Knowledge base updated to v1.0.1.
1.0.1
- Upgraded bundled TCPDF to 7.0.7 (now requires PHP 8.2+).
- Generic CDN hosts are now classified through the bundled knowledge base instead of a hard-coded list.
- Browser beacon is enqueued through
wp_enqueue_scripts. - Hardened scan-token validation, CSV export and settings sanitization.
1.0.0
- Initial release.
- Two-layer detection: server-side DOMDocument scan + browser beacon.
- Anonymous tokenized beacon mode for capturing pixels GTM hides from admins.
- PDF and CSV export.
- Cookie and localStorage detection.
- Scan history and diff.
- Bundled knowledge base of 70+ third-party services.
Follow this listing's changes (Atom feed)