Why does my browser connect to unknown third party sites when I visit different webpages?

Many different reasons.

  1. Almost all ads you see come from 3rd parties.
  2. The developers of the site may use 3rd party libraries to acheive their goals, such as jQuery and others.
  3. The site may depend on data from another site, such as an API.

The list is giant, however these 3 are the main reasons. Most are harmless and nothing to worry about, however, one should always educate themselves of the dangers.

Edit: According to @smonff, you should worry about it


Oxymoron has given 3 common reasons, but in addition (or rather additional clarification) many if not most websites will call scripts from domains such as google-analytics. Some of these scripts attempt to gather information about individual users, while many are more interested in users' interactions with particular sites, or correlations across multiple sites.

Ghostery has already been mentioned as one way of avoiding some of these. You might also consider adblock plus (particularly useful if you are on a slow connection, or come across those ads that expand on mouseover).

Another powerful option is to install noscript. This will block all scripts from any source until you tell it to allow them. It's quite annoying at least at first, before you instruct it about sites you regularly visit. Even with most scripts allowed it still offers some protection against more esoteric threats (though that may be starting to veer off topic) but doesn't strip 3rd party images (for example) unless being called from a script.

These blocking tools aren't mutually exclusive - some combination may be helpful.


I found the Firefox extension Request Policy to be extremely helpful in showing who grabs what from where.

You can decide whether to allow certain queries (e.g. to CDN websites and general APIs, I found out that font.googleapis.com and ajax.googleapis.com are widely used) or to block them.

It took me a while to get proficient with the most harmless queries/sites, but I really got to see the internals of everything a website is requesting to work. It has the charm that you manually control what happens, compared to plugins like Ghostery (that might forward your surfing habits to others).

Happy surfing!