Quick Summary
- Third-party requests are HTTP calls your page makes to external domains.
- Common sources: CDNs, font services, analytics, ad networks, and social widgets.
- Each request exposes user data (IP, referrer, cookies) to the external domain.
- They create supply-chain attack vectors and slow down page performance.
Introduction
When a user visits your website, their browser does not just communicate with your server. Behind the scenes, it makes dozens of additional HTTP requests to external domains, loading fonts from Google, analytics scripts from third-party vendors, advertising pixels from ad networks, and JavaScript libraries from public CDNs.
The average marketing website makes 30–80 third-party requests per page load, often to dozens of different external domains. Each one of these requests transmits the user's IP address, browser information, and referrer URL to the external server, creating both privacy and security risks that most site owners are not even aware of.
This guide explains what third-party requests are, why they are dangerous, and practical steps to identify and reduce them on your website. For deeper browser mechanics, consider the MDN Web Docs on Cross-Origin Resource Sharing (CORS).
What Are Third-Party Requests?
The Silent Network Chain
A third-party request occurs whenever your webpage loads a resource (script, image, font, stylesheet) from a domain different from your own. The user's browser makes a separate HTTP connection to that external server, transmitting data with each request.
Visualizing the Attack Surface
As shown in the diagram, each external domain your page contacts receives the user's IP address, browser fingerprint, and Referer header, revealing which page the user was viewing. If your URL contains PII like email addresses or tokens, that data is leaked to every external domain loaded on the page.
Why Third-Party Requests Matter
Security & Performance Implications
- Supply-chain attacks: A compromised CDN, widget, or third-party script can inject malicious code into your page, stealing user data or payment information.
- Data exfiltration: Scripts can capture keystrokes, form data, or session tokens and send them to external servers without the user's knowledge.
- Cross-site tracking: Ad networks correlate requests across thousands of websites to build detailed user profiles for targeted advertising.
- Performance impact: Each external domain requires DNS lookup, TLS negotiation, and data transfer, adding latency that directly impacts Core Web Vitals and SEO rankings.
- Single points of failure: If an external CDN or service goes down, your site's functionality breaks, even though your own servers are fine.
- GDPR compliance: Each third-party request constitutes a data transfer. Under the GDPR, you need a legal basis for every data transfer to a third party.
Common Sources of Third-Party Requests
| Source | Examples | Data Exposed |
|---|---|---|
| Analytics | Google Analytics, Mixpanel | Page views, user behavior, IP |
| Ad Networks | DoubleClick, Meta Pixel | Browsing history, conversions |
| Fonts | Google Fonts, Adobe Typekit | IP address, browser fingerprint |
| CDNs | cdnjs, unpkg, jsDelivr | IP address, requested resource |
| Social Widgets | Twitter embeds, Like buttons | Social identity, browsing context |
| Chat Widgets | Intercom, Drift, Zendesk | User interactions, PII |
| Session Replay | Hotjar, Microsoft Clarity | Clicks, keystrokes, form inputs |
| Tag Managers | Google Tag Manager, Segment | All data from managed tags |
The Tag Manager Problem
See exactly which external domains your website is contacting.
Run Third-Party AnalyzerReal-World Examples
When Third Parties Go Wrong
| Incident | Vector | Impact |
|---|---|---|
| British Airways (2018) | Compromised third-party JS | 380,000 payment cards stolen → £183M fine |
| Ticketmaster (2018) | Compromised chatbot widget | Customer data exposed via supply-chain attack |
| Google Fonts ruling (2022) | Font loading from Google CDN | German court ruled loading Google Fonts violates GDPR |
| Magecart campaigns | Compromised CDN libraries | Credit card skimmers injected into checkout pages |
The British Airways Case
How to Detect Third-Party Requests
- Run an automated scan: Use the Third-Party Requests Analyzer to get a complete list of every external domain your page contacts, categorized by type.
- Browser DevTools: Open DevTools → Network tab → filter by “third-party” or sort by domain. Count the number of external domains your page contacts.
- Check your CSP violations: If you have a Content Security Policy with reporting enabled, violation logs will reveal unexpected third-party connections.
- Audit Tag Manager containers: Review your GTM/Segment configuration quarterly. Remove tags that are no longer active or were added without security review.
- Full privacy scan: Use the SitePrivacyScore scanner for a comprehensive audit covering third-party requests, cookies, security headers, and compliance signals.
How to Reduce Third-Party Requests
Mitigation Strategies
- Self-host fonts: Download Google Fonts and serve them from your domain. This eliminates a data transfer to Google on every page load.
- Self-host critical libraries: Bundle React, jQuery, and other dependencies instead of loading from public CDNs like cdnjs or unpkg.
- Audit marketing scripts quarterly: Remove inactive trackers and unused widgets. Marketing teams frequently add scripts that are never removed.
- Implement a Content Security Policy: Use a CSP to whitelist only necessary domains. Any request to an unlisted domain will be blocked automatically.
- Use Subresource Integrity (SRI): Add SRI hashes to external scripts to ensure they have not been tampered with since you reviewed them.
- Replace third-party analytics: Consider self-hosted analytics (Plausible, Umami) that keep all data on your servers and make zero third-party requests.
- Lazy-load non-essential widgets: Defer loading chat widgets, social embeds, and non-critical scripts until the user actually interacts with them.
SRI Hash Example
<script src="https://cdn.example.com/lib.js"
integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+"
crossorigin="anonymous"></script>If the file on the CDN has been modified (even by one byte), the browser refuses to execute it.
Best Practices
- Minimize external dependencies, every third-party domain is an attack surface. Only load what you genuinely need.
- Prefer self-hosting, fonts, icons, and JavaScript libraries should be served from your own domain whenever possible.
- Require SRI for all external scripts, this prevents supply-chain attacks by ensuring script integrity.
- Use CSP to enforce a whitelist, new third-party scripts cannot execute unless explicitly approved in your Content Security Policy.
- Gate marketing scripts behind consent, non-essential third-party scripts should only load after the user consents to tracking.
- Monitor your third-party inventory, automated scanning catches new scripts added via Tag Manager without developer review.
Common Mistakes
- Assuming CDN-hosted files are safe: Public CDNs have been compromised before. The cache-sharing benefit no longer exists in modern browsers with partitioned caches.
- Not auditing Tag Manager containers: Marketing teams add scripts to GTM without security review. A quarterly audit is essential to remove stale or unauthorized scripts.
- Loading resources from HTTP: Any third-party resource loaded over HTTP (not HTTPS) creates a man-in-the-middle attack vector and breaks mixed-content protections.
- Ignoring performance impact: Each third-party domain adds 50–200ms of latency (DNS + TLS). Sites with 30+ external domains can see significant Core Web Vitals degradation.
- Forgetting about sub-requests: A single third-party script can trigger its own additional requests to other domains, creating a chain of dependencies you never explicitly loaded.
- No data processing agreements: Under GDPR, you need a Data Processing Agreement (DPA) with every third party that receives user data from your site.
Conclusion
Third-party requests are one of the largest and least-visible attack surfaces on the modern web. Each external domain your page contacts is a potential point of data leakage, supply-chain compromise, and performance degradation. The good news is that many of these requests are unnecessary and can be eliminated through self-hosting, CSP enforcement, and regular auditing.
Start by scanning your site to see exactly how many external domains it contacts, then systematically reduce that number. Fewer third-party requests means better privacy, better security, faster performance, and easier GDPR compliance.
Scan Your Website
Related Guides
Frequently Asked Questions
Why do so many sites use public CDNs if they are dangerous?+
Will a CSP block third-party requests?+
Are Google Fonts a privacy risk?+
How do I find all third-party requests on my site?+
Do third-party requests affect Core Web Vitals?+
Are CDNs still worth using?+
Map Your Third-Party Dependencies
Identify every external domain your website connects to and assess the privacy and security implications.
For deeper runtime checks, run the full privacy audit →