Ad Marketplace

Ad placement is a multi-objective optimization (MOO) problem. There are many factors needed to be taken into account and be optimized:

  • Relevancy
  • Advertiser Value
  • User Value
  • User Experiencce
  • Retention
  • Fairness
  • Basket Size
  • and more …

The Marketing Funnel

          \        Awareness        /
            \    Consideration    /
              \   Conversion    /
               \   Loyalty     /
                \  Advocacy   /


MarketingThe set of activities to attract people to products or services.
PromotionPromotions are one kind of marketing to encourage conversion.
AdsAdvertising or Ads are another kind of marketing.
SurfaceA medium or place for showing ads.
InventoryThe ad slots being offered to advertisers.
ImpressionImpression is defined as the ad being in the viewport for a period of time.
ConversionAn action that is valuable to business (i.e. purchase, call).
RTBReal-time bidding is the process of offering ad slots to advertisers through an online auction.
GoalThe goal that the ad tries to achieve.
TargetingThe group of users who are eligible for the add.
CopyThe text of the add.
CreativeThe visual component of the add (i.e. image, video).
CampaignA unit of advertising that includes a goal, targeting, budget, and the set of copies and creatives.


AdvertiserProvides demand, may work via third-party agencies, generate revenue in the ads marketplace.
PublisherProvides supply through surfaces for displaying ads.
ExchangeMatches ads demand with ads supply, acts as a mediator between publishers and advertisers, and provides value-added services (i.e. analytics).
Demand-Side Platform (DSP)Bids on one or more exchanges on behalf of advertisers. Can also prevent partner advertisers from competing with each other.
Supply-Side Platform (SSP)Offers ads inventory to one or more exchanges on behalf of publishers.

Ad Stack

  • Campaign Management
  • Analytics and Insights
  • Ad Exchange
  • Budget and Pacing
  • Ad Ranking/Pricing
  • Billing
  • Forecasting
  • Fraud Detection
  • Ad Rendering

Ad Exchange Operations

Ad Exchange will provide a marketplace for advertisers and publishers. It matches supply with demand in real-time by maximizing ROI for advertisers and minimizing the impact on user experience.


  • Every time an ad surface is available, a request is sent to the exchange, possibly through an SSP, to display an ad.
  • Depending on the surface and audience (viewing users), a subset of ads will be eligible for display.
  • The exchange will determine the best ad to be placed on the surface.
    • The definition of best depends on a variety of factors (bid price, relevancy, platform value, quality core, etc.).
  • The exchange may pay the publisher by specifying the conditions for compensation and price.
    • Intermediaries (DSP, SSP, exchange, etc.) will each receive a cut for their role in the marketplace.

Auction Theory

  • First-Price Auction
    • All bidders simultaneously submit sealed bids.
    • The highest bidder pays the price that was submitted.
  • Second-Price (Vickery) Auction
    • Bidders submit sealed bids without knowing about others’ bid.
    • The highest bidder wins but the price paid is the second-highest bid (plus 1 cent).
    • This model incentivizes bidders to bid their true value.

Ad Ranking/Pricing

  • When there are multiple ad slots available, we need to decide what ad appears in each slot.
    • We assign a rank no. (position) to each ad.
  • This decision can be made based on a variety of factors:
    • Bid price
    • Ad relevancy (Relevance Score)
    • Ad quality (Quality Score)
  • The rank can be used to decide the billing price for that rank position.


Fixed PriceThe advertiser pays a fixed amount for a certain no. of placements or over a period of time. Using this method, there may be no auction.
Cost Per Thousand Impressions (CPM)The advertiser pays for each impression regardless of if the user takes any action or not.
Cost Per Click (CPC)The advertiser pays each time a user clicks on the add. This is the most common method.
Cost Per View (CPV)The advertiser pays each time a user views the ad video. Viewing can be defined as watching for 10 seconds or more for example.
Cost Per Action (CPA)The advertiser pays each time a user performs an action of interest (purchasing, installing an app, etc.).
Cost Per Engagement (CPE)The advertiser pays for each user engagement (like, retweet, etc.).

Demand-Side Platform (DSP) Operations

Audience Targeting

Advertisers can reach out to different segments of users by specifying various targeting criteria. Tagerting capabilities usually include the following:

  • Location Targeting
  • Demographic Targeting
  • Behavioral Targeting
  • Contextual Targeting
  • Retargeting


  • We can think of pacing in various ways:
    • Pacing defines how ads should deliver over the schedule of the campaign.
    • Pacing controls how a campaign spends its budget. It helps the budget to meet the goals of bidding strategy and vice versa.
    • Pacing defines the goals of a campaign so that the campaign hits a desired metric over the course of its lifetime.
    • Ad Delivery Curve is defined by pacing and sets the goals of the campaign (hourly goals, daily goals, etc.).
  • Pacing is needed for constraints such as dayparting, blackouts periods, holidays, etc.
  • Budget Pacing is required to prevent campaign underdelivery and overdelivery.
    • Campaign Underdelivery
      • Loss of money (unused budget)
      • Loss of money (advertisers may reduce ad spend)
    • Campaign Overdelivery
      • Dilutes cost metrics (CPM, CPC, …)
      • Loss of money (advertisers get free credit and may reduce ad spend)
      • Loss of money (ads that overdeliver prevent other ads from delivering)
  • Pacing (Ad Delivery Curve) can be:
    • Naive: based on an arbitrary distribution (i.e. uniform distribution).
    • Traffic-aware: historical traffic distribution defines the ad delivery curve.
    • Custom: advertiser defines the goals.
  • For pacing to work and staying on the ad delivery curve, there are different approaches:
    • Greedy: spend the budget as fast as possible while the goal is not met.
    • ε-Greedy: optimizes the greedy approach by dropping an ad with probability ε.
    • Model-based: PID Controller, Model predictive control, etc.
  • There are two approaches for tracking ongoing delivery and correcting it:
    • Proactively (biased for underdelivery): assign quota upfront and serve ad if it has not run out of quota.
    • Reactively (biased for overdelivery): count delivery via events and throttle once the threshold is met (goal is met).

Ad Delivery Curve

User Tracking

Advertisers want to track their customer journeys and re-engage with them.

PixelAd exchanges rely on long-lived cookies to be present. Publishers can embed a snippet of code from the exchanges to track users.
Session TokenA session token stored in the session cookie can be leveraged to track users across a single session on the publisher’s surface.
Mobile AppMobile apps leverage either signed-in users or device unique identifiers.

Marketing pixels or tracking pixels are tiny snippets of code to gather information about visitors on a website. They can be used for targeting users, measuring a marketing campaign’s performance, track conversions, and build a targeted audience base. Retargeting Pixels are used for tracking user behavior to tailor ads that they are interested in. Conversion Pixels are used for tracking sales to identify the source of conversions and measure the success or failure of ad campaigns.


Performance Metrics

Ad SpendAmount of money spent on an ad campaign.
CPM, CPC, CPV, CPA, CPEDescribed above.
Click Through Rate (CTR)The ratio of impressions that result in a click.
Return On Ad Spend (ROAS)The attributed value of sales over the cost of the advertising used for selling.
Conversion RateThe ration of impressions that result in a sale.


Marketing attribution is the practice of determining which marketing channels and advertisements are contributing to sales or conversions.

First-TouchAttributes the conversion to the first ad that the user has interacted with it.
Last-TouchAttributes the conversion to the last ad that the user has interacted with it.
Multi-TouchAttributes the conversion equally to all ads that the user has interacted with them.
Weighted Multi-TouchAttributes the conversion differently to the ads based on how the user has interacted with each of them.

If multiple ads were involved in the customer journey, each may take 100% credit for the sale which results in an attributed value greater than the value of the sale.

Reading More