DM8: Advertising through code: buying, automating and measuring ads
How online ads are bought
🎯You'll be able to
Describe search, social, marketplace and programmatic ads, and the parts of a programmatic auction.
🏠The everyday picture
A shop can rent a billboard on a fixed road for a month, or pay a newspaper vendor to slip its leaflet only into papers delivered to houses with gardens. Online ads offer both, and an auction decides the price each time.
📘What it really is
-
Search ads: shown above or below organic results for chosen keywords, labelled "Sponsored". Advertisers usually pay per click (CPC).
-
Social ads: shown in feeds and stories (Instagram, Facebook, YouTube), targeted by interests, location, age and lookalike audiences; often paid per thousand impressions (CPM) or per click.
-
Marketplace ads: sponsored products inside Amazon, Flipkart and others, where many Indian shoppers start their search.
- Programmatic advertising buys display, video and app ads automatically, impression by impression:
- a publisher's page or app has an ad slot;
- its supply-side platform (SSP) offers the impression to an ad exchange;
- advertisers' demand-side platforms (DSPs) bid in a real-time auction that takes a fraction of a second;
-
the winner's ad is shown. The OpenRTB standard describes these messages.
-
Auctions: many exchanges now run first-price auctions (you pay what you bid); search platforms combine bid and ad quality into an ad rank, and you usually pay less than your maximum bid.
-
Ad fraud and invalid traffic: bots and fake sites generate impressions and clicks.
ads.txtfiles on publishers' sites list who is authorised to sell their inventory.
📝A worked example
Input: MittiMart wants more festival buyers for diya packs in Odisha.
| Option | How it's bought | Fits when |
|---|---|---|
| Search ads for "diya pack online" | CPC auction on keywords | People are already searching |
| Instagram ads with a short video | CPM or CPC, targeted by region and interest | Creating demand before the festival |
| Marketplace sponsored listing | CPC inside the marketplace | Shoppers start on the marketplace |
| Programmatic display | Real-time auctions through a DSP | Large reach budgets, with brand-safety controls |
Expected output: a short note recommending search ads for existing demand and social ads for awareness, with budgets to be tested (Lesson 4). (Planning example; no ads are bought in the kit.)
🌍Where it's used
- D2C brands split budgets between search, social and marketplaces.
- Media agencies run programmatic campaigns through DSPs for large advertisers.
- Publishers sell inventory through SSPs and keep
ads.txtfiles up to date.
📝Case scenario
A fashion brand bought cheap programmatic display impressions and saw high click-through rates but no sales. An audit found most clicks
came from a handful of app placements with accidental taps and bot traffic. Excluding them and buying only from sellers listed in
publishers' ads.txt files cut clicks sharply and raised sales per rupee spent.
🖱️Try it
Search for a product and note the sponsored results; then open a news site and note the display ads. For one ad of each kind, guess how the advertiser pays (per click or per thousand impressions). Success: one guess for each, with a reason.
⚠️Common mistakes
- Judging ads by clicks alone. Sign: a high CTR celebrated with no sales. Fix: judge by conversions and incrementality (Lesson 4).
- Buying the cheapest impressions. Sign: very low CPMs from unknown apps. Fix: brand-safety lists,
ads.txtchecks and fraud filters. - Ignoring marketplaces. Sign: no plan for where Indian shoppers start searching. Fix: include marketplace ads where relevant.
🛠️For your project
The capstone's design notes include an advertising plan for MittiMart: channels, an illustrative budget and how you'd measure it.
✅Quick check
In programmatic advertising, what does a DSP do?
Show the answer
It bids on impressions for advertisers in real-time auctions.
What does a publisher's ads.txt file list?
Show the answer
The companies authorised to sell its ad inventory.
