Back to Blog

How Retargeting Ads Work: The Technical Explanation

PB

Patrick Bushe

March 24, 2026 · 5 min read

You look at a pair of shoes on a shop's website, leave, and then see those shoes in ads on news sites and social media for weeks. That's retargeting. Here's what happens behind the scenes.

1. The pixel fires

The shop's pages include small pieces of code from ad platforms, often called pixels or tags, such as the Meta Pixel or a Google tag. When you view a product, the code sends an event to the ad platform: "viewed product 1234", along with an identifier for you, such as a cookie or a signed-in account.

2. You join an audience list

The ad platform adds your identifier to the shop's audience lists, such as "viewed shoes in the last 30 days" or "added to cart but didn't buy". How long you stay depends on the list's settings. Google Ads allows up to 540 days, and Meta's website audiences up to 180 days.

3. You visit another site

When a page with ad space loads, it sends an ad request. That request includes identifiers the ad platform can recognize, plus details about the page and your device.

4. The auction

The ad platform, or an ad exchange running a real-time auction, checks whether you're on any advertiser's audience lists. The shoe shop has told it to bid more for people who looked at shoes. If its bid wins, its ad is shown. This all happens in a fraction of a second.

5. The ad shows what you viewed

Dynamic retargeting uses the shop's product feed, a list of its products, prices and images, to build an ad showing the exact items you looked at, sometimes with similar products.

6. It stops, eventually

Advertisers usually remove buyers from the list, cap how often you see ads, and let you drop off the list after a set time.

Why it still works with cookie limits

Safari and Firefox restrict third-party cookies, so retargeting increasingly uses:

  • Signed-in accounts on big platforms, which recognize you without third-party cookies.
  • Server-side tracking, where the shop sends events directly from its server. See conversion APIs.
  • Email addresses you enter at checkout or sign-up.

How to stop seeing retargeted ads

  • Block third-party cookies and clear cookies for shopping sites.
  • Reject non-essential cookies on banners.
  • Turn off personalized ads in Google's My Ad Center and Meta's Ad preferences.
  • Shop while signed out of social accounts, or in a separate browser profile.
  • Ghost Browser adds random background visits, so interest profiles built from your browsing are less accurate.

See how ad networks build a profile.

More Tools by Patrick Bushe

Free Chrome extensions to boost your productivity and privacy