How Online Ad Targeting Actually Works
Published 2026-06-02
Behind every ad you see is a real-time auction informed by hundreds of signals. Here's a non-technical walkthrough of how it all fits together.
The Real-Time Auction
When you load a webpage with an ad slot, here's what happens in the ~100ms before the ad appears:
- The page sends a 'bid request' to an ad exchange. The request includes everything the page knows about you: cookies, browser fingerprint, page topic, time of day, geographic location.
- The exchange forwards the request to dozens or hundreds of potential advertisers (or their bidding systems).
- Each advertiser's system looks up your profile against their own data, computes how valuable you are to them, and bids accordingly.
- The highest bidder wins. Their ad creative is sent back and rendered in the slot.
This whole auction happens in milliseconds, every single time. Trillions of these auctions happen per day across the web.
What Goes Into the Bid Request
- The URL of the page you're loading
- The topic / category of the page (from publisher-supplied metadata)
- Your IP address and inferred geolocation
- Your device type, OS, browser
- Cookie identifiers from any ad networks present on the page
- The page section the ad is for (above-fold vs below, etc.)
- Your inferred 'audience segments' from prior data sharing (e.g. 'in-market for car insurance', 'frequent traveller')
Where Targeting Data Comes From
- First-party — what the website you're on knows about you (you logged in once, you bought something, you visited certain product pages)
- Second-party — data the publisher receives from a specific partner
- Third-party — aggregate behavioural profiles bought from data brokers
- Contextual — based on the page topic, not on you specifically (a financial article gets financial ads regardless of viewer)
- Lookalike — ad platforms compute 'similar to my existing customers' audiences from large behavioural datasets
Why You See the Ads You See
The ad you see is the one whose advertiser bid the most for you on that page. That bid is based on:
- How much your inferred profile matches the advertiser's ideal customer
- The historical click-through rate of similar users on this advertiser's ads
- The advertiser's overall budget and target spend rate
- The competition for your specific impression at that moment
This is why high-value targets (real-estate seekers, car shoppers, divorce lawyers' prospects, B2B decision-makers) see expensive, polished ads — the bids for these audiences are 100x higher than for random browsers.
Why 'I Saw a Product Then Got Ads for It' Isn't Mind-Reading
The common observation: 'I searched for X and now I'm seeing X ads everywhere.' The mechanism is retargeting: the site you searched on dropped a cookie / pixel that flagged you as 'interested in X'. Every ad-network impression on every other site now bids extra to show you X ads. There's no microphone listening to your conversations — just very effective web tracking.
Defences
- uBlock Origin or equivalent — blocks the ad-network scripts that contribute to the bid request
- Brave Browser — built-in tracker blocking + private ad replacement
- Disable third-party cookies (Safari/Firefox default; Chrome opt-in)
- Use Apple's App Tracking Transparency to block app-based tracking on iOS
- Avoid logging in to sites you don't trust to handle your profile responsibly
Bottom Line
Ad targeting is a vast, automated system running in the background of every ad-supported site you visit. You can opt out of much of it via browser settings and tracker blockers, but you can't fully escape it without leaving the ad-supported web. Decide where you draw the line and use the right tools.
Related Guides
See also: how cookie tracking works, how data brokers profile you, and 'anonymous data' debunked.