Dev.to Security 🔐 Cybersecurity 👁 0 📖 4 min read

How to see which trackers your website loads (and why it matters for privacy)

Disclosure: I'm part of the team behind FastAnalytics. One of the methods below uses our free tracker checker, but the other two only need your browser. Most websites load far more third-party code than their owners th

Disclosure: I'm part of the team behind FastAnalytics. One of the methods below uses our free tracker checker, but the other two only need your browser.

Most websites load far more third-party code than their owners think. A theme adds a font service, a plugin adds a chat widget, someone pastes a pixel for one campaign and nobody ever removes it. Each of those scripts can set cookies, collect data and slow the page down.

If someone asks you "which companies does your website send visitor data to?", can you answer in five minutes? Here's how.

Why it matters

1. Privacy and consent. In the EU, storing or reading information on a visitor's device (cookies, local storage and similar) generally needs consent unless it's strictly necessary for the service the visitor asked for. Analytics, advertising and session-recording tools usually aren't. If a tracker runs before the visitor clicks "Accept", that's a problem, even if your banner looks perfect.

2. Accountability. Your privacy policy should list who receives data. You can't list what you don't know is there.

3. Performance. Every third-party script is another DNS lookup, connection and download, often on the critical path. Removing one forgotten pixel can be the cheapest speed win you'll find.

Method 1: Your browser's developer tools (most complete)

This shows everything, including scripts loaded later by a tag manager.

  1. Open your site in a private window (so no old cookies or consents interfere).
  2. Open DevTools (F12) → Network tab, then reload.
  3. Don't touch the cookie banner yet. Sort by Domain and look for anything that isn't your own domain.
  4. Go to Application → Cookies to see which cookies already exist before consent.
  5. Now click Reject on the banner and reload. Anything analytics or advertising that still loads is worth a closer look.
  6. Finally click Accept and compare.

A quick console snippet

Paste this in the DevTools Console to get a list of every third-party domain the page has loaded resources from so far:

(() => {
  const own = location.hostname.replace(/^www\./, "");
  const counts = {};
  for (const e of performance.getEntriesByType("resource")) {
    const host = new URL(e.name).hostname;
    if (host === own || host.endsWith("." + own)) continue;
    counts[host] = (counts[host] || 0) + 1;
  }
  console.table(
    Object.entries(counts)
      .sort((a, b) => b[1] - a[1])
      .map(([domain, requests]) => ({ domain, requests }))
  );
})();

It won't tell you what each domain is, but it's a fast inventory. Run it before and after interacting with the cookie banner to see what changes.

Note: a few hosts (CDNs you control, your own subdomains on another domain) will show up too. That's fine; the point is to make sure nothing surprises you.

Method 2: A quick external check (fastest)

If you just want a first answer without opening DevTools, or you want to check a client's or competitor's site, an external checker downloads the page and inspects the HTML and response headers.

Our free Tracker and cookie checker does this with no sign-up. It recognises around 45 common analytics, advertising, session-recording, cookie-banner, chat and embed tools; lists the cookies the server sets (with lifetime and Secure/HttpOnly/SameSite flags, never their values); shows which other companies' domains the page loads from; and estimates the weight of the third-party scripts it recognises.

Its honest limits (true of any external checker):

  • It sees the code the server delivers. Scripts injected later by JavaScript, for example through Google Tag Manager or after a visitor accepts the banner, won't appear.
  • It can't see cookies created in the browser by scripts (GA4's _ga cookie, for example).
  • It's guidance, not a legal assessment.

So use it as a quick first pass, and Method 1 for the full picture.

Method 3: Check your tag manager and plugins (the root cause)

Trackers tend to come back if you only remove them from the page. Find where they come from:

  • Tag manager (GTM or similar): list every tag, its trigger, and whether it respects consent. Delete tags for campaigns that ended.
  • CMS plugins: on WordPress, many plugins add their own scripts. Disable one at a time on a staging site and re-run the console snippet.
  • Theme and embeds: fonts, maps, video embeds and social buttons all load third-party code. Self-hosted fonts and "click to load" embeds avoid most of it.

A simple monthly checklist

  • [ ] Run the console snippet on the home page, a product/article page and the checkout or contact form.
  • [ ] Confirm nothing analytics, advertising or recording-related loads before consent.
  • [ ] Compare the list of domains with your privacy policy.
  • [ ] Remove anything nobody can explain.
  • [ ] Re-check after installing a plugin or launching a campaign.

Where cookieless analytics fits

One way to reduce the list is to use analytics that doesn't set cookies or store anything on the device. Tools like Plausible, Fathom, Simple Analytics, Umami and FastAnalytics work that way. Whether you still need consent for them depends on your jurisdiction and on everything else your site loads, which brings you back to step one: know what's on your page.

What's the most surprising third-party script you've found on a site you manage?

This is not legal advice. For compliance questions, talk to a privacy professional.

Cover photo by Jason Dent on Unsplash.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.