You look at a pair of shoes once, and for the next week they appear on every website you visit. That is not a coincidence. It is the result of a large, automated advertising system working behind the scenes. Understanding how it works helps you make better privacy choices and also explains how free websites pay their bills.

Why most websites show ads

Writing articles, hosting servers and maintaining a website all cost money. Many sites choose to offer content for free and earn revenue from advertising instead of charging a subscription. Advertisers pay to reach people who might be interested in their products, and websites earn a share when ads are displayed or clicked.

The main players

  • Advertisers want to promote a product or service.
  • Publishers are the websites and apps that show ads.
  • Ad networks connect many publishers with many advertisers. Google AdSense is a well-known example.
  • Ad exchanges are automated marketplaces where ad space is bought and sold in real time.
  • Demand-side and supply-side platforms are software tools that let advertisers bid and publishers sell inventory.

What happens in the half second before a page loads

  1. You open a web page that has an ad slot.
  2. The page tells an ad server or exchange that a visitor is about to see an ad, along with limited details such as the page topic, your general location and a device or cookie identifier.
  3. Advertisers’ systems instantly decide whether they want to show an ad to this visitor and how much they will bid. This process is called real-time bidding.
  4. The highest bid wins, and its ad is sent to your browser and displayed.

All of this takes only a few hundred milliseconds, and it happens for every ad on the page.

Cookies, the original tracking tool

A cookie is a small file that a website stores in your browser. First-party cookies are set by the site you visit and are used for logins and preferences. Third-party cookies are set by other companies embedded in the page, such as advertisers, and can recognise you across multiple sites. Browsers like Safari and Firefox block many third-party cookies by default, and the industry has been moving toward alternatives.

Tracking pixels

A tracking pixel is a tiny, often invisible image or script that loads from an advertiser or analytics provider. When your browser requests it, the provider learns that you visited a page or opened an email, plus technical information such as your IP address and browser type. Pixels are used to measure whether ads lead to purchases, a process called conversion tracking, and to build audiences for retargeting.

Retargeting and interest-based ads

Retargeting shows you ads for products you viewed. Interest-based advertising groups visitors by topics, such as travel or technology, and shows relevant ads. Contextual advertising, which matches ads to the content of the page you are reading rather than to your history, is a more privacy-friendly alternative that is gaining popularity.

How to take control

  • Use the cookie banner. Reject non-essential cookies or choose only the categories you accept.
  • Adjust ad personalisation. Google, Meta and other platforms let you turn off personalised ads in your account settings, for example at Google Ads Settings.
  • Reset your advertising ID. Android and iOS let you delete or limit your device’s advertising identifier.
  • Tune your browser. Block third-party cookies and keep the browser updated. See our browser tips.
  • Use private browsing for sensitive searches, understanding it hides history locally but does not make you invisible online.
  • Consider a privacy-focused DNS or tracker-blocking tools if you want stronger protection.

What this means for website owners

Publishers must clearly tell visitors which cookies and advertising partners they use, ask for consent where the law requires it, and publish a privacy policy. They should also never encourage visitors to click ads, since ad networks forbid it and it harms trust.

Final thoughts

Online advertising is not magic, and it is not all bad. It is a fast, automated marketplace that funds much of the free web, but it relies on data about you. Knowing how cookies, pixels and exchanges work lets you decide how much you are willing to share and which sites deserve your support.