Join our Newsletter — 33% off our NHI Course
Home› Guides› How Online Ads Work for Beginners: Ad auctions,…
Guide Security Policies & Awareness

How Online Ads Work for Beginners: Ad auctions, trackers and why malvertising happens

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 1 December 2026 10 min read
On this page

Online ads are chosen in a fast automatic auction each time a page loads, using data about you.

This guide is for anyone who wonders why ads seem to follow them around, or why a search ad can lead to a fake site. You do not need to know anything about marketing.

In short

  • Many ads are picked by real-time bidding: buyers bid for the ad space while the page loads.
  • Trackers such as cookies and pixels help buyers decide what to bid on you.
  • Criminals can buy ads too. Ads that lead to harmful sites are called malvertising.
  • Checking the web address, typing it yourself and tuning your browser's privacy settings all help.

What you will learn

  • Describe what happens in the moment between loading a page and seeing an ad.
  • Explain how trackers help decide which ad you see.
  • Explain why a harmful ad can appear on a trusted site or search page.
  • Take simple steps to cut tracking and avoid fake ads.
Ad slot
a space on a page or app where an ad can appear.
Bid
an offer of money to show an ad in that slot.
Tracker
a tool that records what you do online so ads can be aimed at you.

What is online advertising?

Picture a fast auction house. Each time you open a web page, the empty ad space is put up for sale. Buyers look at a card describing the space and the visitor, then shout their bids. The winner's poster goes up.

Real-time bidding works like this. When there is an ad space to fill, a request goes out to bidders describing the chance to show an ad. Each bidder can reply with a bid and the ad it wants to show [1].

It is very fast. Google's buyer documentation says it waits between 80 and 1,000 milliseconds for a reply, and late replies are left out [1]. The highest bid that arrives on time wins, and its ad is shown [1].

Where the comparison stops working: in a real auction house the buyers are in the room and you can see them. Online, you never see who bid, and the "card" about you may hold more than you would expect.

Why does it matter?

Ads pay for much of the free web. The same system also collects data about people and can carry harmful ads to trusted pages.

If you browse and search every day

What could happen: you click a top search ad for a well-known brand and land on a fake copy of its site.

Check this: look at the web address before you click, or type it yourself.

Next: Drive-by Downloads and Malvertising for Beginners

If you care about privacy

What could happen: trackers follow you across many sites and build a picture of your interests.

Check this: review your browser's privacy settings and cookie choices.

Next: Browser Privacy and Security Settings Guide

If you work in IT

What could happen: staff download "free" software from a fake ad and bring malware into work.

Check this: tell staff where approved software comes from, and make that easy to find.

Next: Verifying Software Downloads for Beginners

What does it look like?

Here is a made-up, simplified bid request. Real ones are longer, but the idea is the same.

Example only. All values are made up.

{
  "slot":     "top banner, 728x90",         (1)
  "site":     "news.example.com/sport",     (2)
  "device":   "phone, EXAMPLE-browser",     (3)
  "user_id":  "0000-FAKE-0000",             (4)
  "deadline": "fast"                        (5)
}
  1. Which space is for sale and its size.
  2. The page you are reading, which hints at your interests.
  3. The kind of device and browser you use.
  4. In a real file, this line would contain an ID that lets buyers link this visit to others.
  5. Buyers must reply before a short deadline or miss out.

Why this is risky: details about you go to many buyers, and you cannot see which ones.

The safer way: limit tracking in your browser and phone settings, so less data about you goes into each request.

How does it work?

  1. A page loads with an empty ad slot. The site has agreed to sell that space through an ad system.
  2. A bid request goes out. It describes the slot and, often, the visitor.
  3. Buyers bid. Each buyer's software decides in a fraction of a second what the slot is worth.
  4. The ad is shown. The top bid that arrives in time wins, and its ad appears on your screen [1].
Diagram titled What happens when a page with an ad loads. Four boxes in a row joined by arrows: 1, page loads, the site has an empty ad slot; 2, bid request, details about the slot and the visitor go out; 3, auction, buyers bid in well under a second; 4, ad shown, the top bid wins and its ad appears. A note underneath says trackers such as cookies and pixels feed step 2, and a bad advertiser can win step 3 too.
Figure 1. The ad auction that runs while a page loads.

Where trackers fit. The US Federal Trade Commission explains that sites may use a cookie or pixel to recognise you even after you leave [2]. Apps may use an advertising ID, and some sites use device fingerprinting [2]. Third-party trackers follow you across many sites so advertisers can target ads at your interests [2].

Where malvertising fits. Anyone who can pay can try to win an auction or buy a search ad. The FBI warned in December 2022 that criminals buy search ads that pretend to be real brands [3]. The ads lead to lookalike sites that can spread ransomware or steal sign-in and payment details [3].

A worked example

This story is made up to show the idea.

Celia Tanaka manages the office at a small accounting firm. A colleague, Talia Dube, needs a free PDF editor for a client job. Talia searches for the tool's name and clicks the first result, which is marked as an ad.

The page looks just like the real maker's site. Talia downloads the installer, but her work laptop blocks it and shows a warning. She calls Celia.

Celia looks at the address bar. The web address has one extra letter compared with the real one. The site was a copy, reached through a paid ad that sat above the real result.

Celia asks Talia not to run the file and deletes it. She reports the ad to the search engine and tells the firm's IT support company, which checks the laptop and finds nothing installed.

Then Celia makes two changes. She adds an approved software list to the firm's shared drive, with direct links to each maker's real site. She also asks IT to switch on an ad blocker in the work browser for searches.

At the next team meeting, she shows everyone the fake address next to the real one. Most people had never noticed that the top search result can be an ad.

Myths and mistakes

What people thinkWhat is true
The top search result is the most trusted one.The top results are often paid ads. Criminals can buy them too.[3]
Private browsing stops tracking.The FTC says private browsing does not stop sites from seeing your activity.[2]
An ad blocker also stops malware.Ad blockers do not block all ads or tracking, and they do not detect viruses or malware.[2]
A trusted site only shows trusted ads.Many sites sell space through automated auctions, so the site may not pick each ad itself.
Opting out once covers everything.The FTC advises opting out on each device and browser.[2]

What can I do this week?

  • Open your browser's privacy settings and review what is allowed.
  • Reset or limit the advertising ID on your phone.
  • Bookmark the real sites you use for banking and software downloads.
  • Read Drive-by Downloads and Malvertising for Beginners for more on harmful ads.

Checklist

  • I know most ads are chosen in an automatic auction as the page loads.
  • I know cookies, pixels and advertising IDs help target ads.
  • I check the web address before I click a search ad.
  • I type or bookmark the address of important sites.
  • I download software only from the maker's real site or an approved store.
  • I have reviewed my browser and phone privacy settings.
  • I know ad blockers help but do not replace security software.

Common questions

Why do ads seem to follow me from site to site?

Third-party trackers can recognise you on many different sites. That lets advertisers show you ads based on what you looked at before. Clearing cookies and tightening browser settings can reduce this, though it will not stop all of it.

How fast is an ad auction?

Very fast. One large ad system's documentation says it waits between 80 and 1,000 milliseconds for each buyer to reply. That is why ads can appear almost as soon as the page does.

Is clicking an ad dangerous?

Most ads are harmless. The risk is that a criminal paid for an ad that copies a real brand. Check the web address carefully, and for important sites, type the address yourself or use a bookmark instead of clicking an ad.

Should I use an ad blocker?

It can help. The FBI suggests one during searches to avoid fake ads. Ad blockers do not catch all ads or trackers, and they are not antivirus software, so keep your other protections on as well.

Who sees the data in a bid request?

The ad system sends bid requests to the buyers taking part in the auction. As a visitor you cannot see which buyers got the request. Limiting tracking in your settings reduces what each request says about you.

Where next?

Ready for the detail? Read the practitioner guide: Malvertising and SEO Poisoning Guide. It covers how fake ads and poisoned search results work and how teams defend against them.

Also useful:

Related NHI Mgmt Group resources: Browser Notification Scams for Beginners, HIPAA and Online Tracking Technologies and Content Delivery Networks (CDNs) for Beginners.

Key terms

Real-time bidding
An automatic auction that sells one ad space to the highest bidder while a page loads.
Ad tech
The software and services that buy, sell, target and show online ads.
A small file a website stores in your browser to remember you.
Tracking pixel
A tiny hidden image that reports when a page or email is opened.
Device fingerprinting
Recognising a device from its mix of settings and features, without a cookie.
Malvertising
Using online ads to spread malware or lead people to scam sites.
Lookalike domain
A web address made to look like a real one, often with a small spelling change.

Sources and further reading

  1. Google for Developers, "Get started with real-time bidding", Authorized Buyers documentation. https://developers.google.com/authorized-buyers/rtb/start (accessed 1 Dec 2026).
  2. US Federal Trade Commission, "How To Protect Your Privacy Online", FTC Consumer Advice. https://consumer.ftc.gov/articles/how-protect-your-privacy-online (accessed 1 Dec 2026).
  3. FBI Internet Crime Complaint Center, Public Service Announcement I-122122-PSA on brand impersonation in search engine ads, 21 December 2022. https://www.ic3.gov/PSA/2022/PSA221221 (accessed 1 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.