Third-Party Requests Explained

How external requests from your website create security vulnerabilities and privacy risks.

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

Third-Party Request Chain & Data ExposureUser visits yoursite.comBrowser parses HTMLfonts.google.comcdn.analytics.comads.network.comIP + Referer sentBehavior trackedProfile built ⚠Each request exposes user data

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

SourceExamplesData Exposed
AnalyticsGoogle Analytics, MixpanelPage views, user behavior, IP
Ad NetworksDoubleClick, Meta PixelBrowsing history, conversions
FontsGoogle Fonts, Adobe TypekitIP address, browser fingerprint
CDNscdnjs, unpkg, jsDelivrIP address, requested resource
Social WidgetsTwitter embeds, Like buttonsSocial identity, browsing context
Chat WidgetsIntercom, Drift, ZendeskUser interactions, PII
Session ReplayHotjar, Microsoft ClarityClicks, keystrokes, form inputs
Tag ManagersGoogle Tag Manager, SegmentAll data from managed tags

The Tag Manager Problem

Tag Managers are particularly risky because they allow marketing teams to add new tracking scripts without developer review. A single GTM container can load dozens of third-party scripts that were never vetted for security or privacy compliance.

See exactly which external domains your website is contacting.

Run Third-Party Analyzer

Real-World Examples

When Third Parties Go Wrong

IncidentVectorImpact
British Airways (2018)Compromised third-party JS380,000 payment cards stolen → £183M fine
Ticketmaster (2018)Compromised chatbot widgetCustomer data exposed via supply-chain attack
Google Fonts ruling (2022)Font loading from Google CDNGerman court ruled loading Google Fonts violates GDPR
Magecart campaignsCompromised CDN librariesCredit card skimmers injected into checkout pages

The British Airways Case

Attackers compromised a single third-party JavaScript library loaded on the British Airways checkout page. The malicious code silently copied payment card details to an attacker-controlled server for 15 days before being detected. A Content Security Policy would have prevented this by restricting which domains could receive data from the page.

How to Detect Third-Party Requests

  1. 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.
  2. Browser DevTools: Open DevTools → Network tab → filter by “third-party” or sort by domain. Count the number of external domains your page contacts.
  3. Check your CSP violations: If you have a Content Security Policy with reporting enabled, violation logs will reveal unexpected third-party connections.
  4. Audit Tag Manager containers: Review your GTM/Segment configuration quarterly. Remove tags that are no longer active or were added without security review.
  5. 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

  1. Self-host fonts: Download Google Fonts and serve them from your domain. This eliminates a data transfer to Google on every page load.
  2. Self-host critical libraries: Bundle React, jQuery, and other dependencies instead of loading from public CDNs like cdnjs or unpkg.
  3. Audit marketing scripts quarterly: Remove inactive trackers and unused widgets. Marketing teams frequently add scripts that are never removed.
  4. Implement a Content Security Policy: Use a CSP to whitelist only necessary domains. Any request to an unlisted domain will be blocked automatically.
  5. Use Subresource Integrity (SRI): Add SRI hashes to external scripts to ensure they have not been tampered with since you reviewed them.
  6. Replace third-party analytics: Consider self-hosted analytics (Plausible, Umami) that keep all data on your servers and make zero third-party requests.
  7. 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

  1. Minimize external dependencies, every third-party domain is an attack surface. Only load what you genuinely need.
  2. Prefer self-hosting, fonts, icons, and JavaScript libraries should be served from your own domain whenever possible.
  3. Require SRI for all external scripts, this prevents supply-chain attacks by ensuring script integrity.
  4. Use CSP to enforce a whitelist, new third-party scripts cannot execute unless explicitly approved in your Content Security Policy.
  5. Gate marketing scripts behind consent, non-essential third-party scripts should only load after the user consents to tracking.
  6. 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

Scan your website with SitePrivacyScore to detect all third-party requests automatically. Our free scanner identifies every external domain, classifies request types, and flags potential privacy risks.

Related Guides

Frequently Asked Questions

Why do so many sites use public CDNs if they are dangerous?+
Historically, browsers cached files cross-site. A user who loaded jQuery from a CDN on one site would have it cached for all other sites. Modern browsers now partition caches per-site, eliminating this benefit while the security risks remain.
Will a CSP block third-party requests?+
Yes. A strict Content Security Policy with whitelist-only directives (script-src, connect-src) will block requests to unlisted domains, preventing unauthorized data exfiltration.
Are Google Fonts a privacy risk?+
Yes. Loading fonts from fonts.googleapis.com sends the user's IP address, browser info, and referrer URL to Google servers. Self-hosting fonts eliminates this data transfer.
How do I find all third-party requests on my site?+
Use the free Third-Party Requests Analyzer to scan any URL. It identifies every external domain your page communicates with and classifies the request types.
Do third-party requests affect Core Web Vitals?+
Yes. Each external domain requires DNS lookup, TLS negotiation, and data transfer. This affects Largest Contentful Paint (LCP), interaction latency (INP), and Cumulative Layout Shift (CLS).
Are CDNs still worth using?+
Using your own CDN (same domain or subdomain) is still beneficial. The risk comes from loading resources from domains controlled by third parties, where you have no control over the content served.

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 →