Clear search
Close search
Google apps
Main menu

Ad selection white paper

Introduction to ad serving (2:00)

Table of contents


This white paper describes the tools and mechanics of the ad selection process in DoubleClick for Publishers (DFP), as well as how a creative is chosen from within a selected line item. It is intended for network administrators, traffickers, and salespeople, and assumes a general understanding of the DFP system and concepts of ad serving.

Notes and definitions

  • In the context of this document, we refer to HTTP as the protocol used in ad serving. DFP fully supports HTTPS, and Google is committed to moving to an "HTTPS Everywhere" model to protect user privacy. See the blog post, Ads Take a Step Towards “HTTPS Everywhere” for more details.
  • When using GPT's Single Request Architecture (SRA), all ad slots on a page are requested using a single HTTP request.
  • When a page contains multiple ad slots, the order in which you define slots in the ad tags should match the order in which you want the ads to be selected and served by DFP. The slot order can have a big impact on serving behaviors discussed later in this document, like roadblocking and creative rotation. Learn more about slot definition and sequentiality.
  • Tag syntax is outside the scope of this article and is covered in the article on generating DFP ad tags.
  • Implementation details for demand side platforms (DSPs) are outside the scope of this article.

Overview of the ad selection process

DFP's ad selection process is designed to deliver the right ad to the right customer at the right time. Below is the process that DFP follows to select an ad to serve:

This infographic describes the ad selection process in DFP

FIGURE 1: Overview of the ad selection process
  1. A user's web browser or mobile device loads a DFP ad tag (on a site) or DFP ad code (in an app) and triggers an ad request to a DFP ad server.
  2. The ad request passes information to the ad server.
  3. The ad server creates a list of all line items matching the targeting criteria.
  4. The ad server selects the best line item to serve by scanning the list of eligible matching line items, starting with highest priority and working down until it identifies the best candidate line item.
    • If dynamic allocation is enabled, DFP checks to see if a remnant line item can be served without affecting the delivery goals or pacing for the candidate line item. This increases overall yield for the network without increasing the risk of underdelivery.
  5. The ad server selects the best creative from within the selected line item.
  6. The ad server serves the creative to the user.

The ad selection process

The sections that follow provide detailed information about each stage in this process.

1. An ad request is triggered

Ad requests are triggered by resources (for example, JavaScript libraries like GPT on web pages, or application code on a mobile app) rendered by a user's web browser or mobile device, and they initiate an HTTP request to an ad server.

2. Information is passed to the ad server

Information about the user and the device is passed within the request to DFP, allowing DFP to match the right ad with the right user. Five crucial pieces of data are transmitted in the ad request:

  • The HTTP header
  • The IP address
  • A user identifier (containing no personally identifiable information), which could be one of the following:
    • Resettable mobile device advertising ID (for in-app ad requests; examples: AdID for Android; IDFA for iOS; other identifiers for devices such as Roku)
    • PPID (for publishers that have it set in their ad requests)
    • DoubleClick cookie (for desktop and mobile browsers)
  • The custom targeting criteria set by the publisher in the DFP ad tags
  • A "correlator" value shared between ad requests on the same page

The table below details how this data is used in the ad selection process. The DFP ad server only checks DoubleClick user identifiers if they are allowed by the individual user; that is, if the user hasn't opted out or blocked them via browser settings or mobile tracking restrictions.

Summary of data types (table)
Data Provides information on
HTTP header Browser type
Operating system
Date and time
IP address Geographic location
Internet-related targeting information like user domain
User identifier Frequency capping
Creative rotation
Audience list membership
DFP ad tags Ad unit and size
Which creative types the ad unit can receive
Custom targeting parameters (key-values)
Correlator value Which ad requests belong to the same page view (used for
advanced serving functionality like roadblocking)

3. A list of matching line items is created

Once the ad server gathers the relevant information for the ad request, it generates a list of all line items that match a subset of the targeting criteria of the request.

For example, if the request comes from a man in California using Linux:

  • A line item targeting Men in California is on the list.
  • A line item targeting Men in California on Windows is not on the list.
  • A line item targeting Men in Vermont is not on the list.
About inventory matching: The ad server considers all line items targeting a piece of inventory anywhere between the ad unit and the network level (ad unit hierarchy is available in DFP Premium only). This enables easy creation of run-of-site and run-of-network ads without the need to explicitly target every ad unit in the tree. For example, a line item that’s run-of-network and targeted to Sports or to Baseball could serve to a tag with a first-level ad unit called Sports and a second-level ad unit called Baseball.

4. The best line item is selected

From the list of matching line items, the ad server then removes any line items that aren't eligible to serve for various reasons, such as:

  • Frequency capping
  • Day parting
  • Exclusions (competitive restrictions and similar line items)

The ad server also looks at the correlator value passed within the request to identify other ads that have already been chosen to serve in this page view. Ads previously chosen to serve on the page can affect eligibility of other line items to serve within the page view, in cases such as:

  • Roadblocking (showing two or more creatives together) or as-many-as-possible (AMAP). (Roadblocking is available in DFP Premium only.)
  • Advertiser exclusions (preventing two advertisers with competing businesses from showing up on the same page)

Once the list of eligible line items is prepared, DFP goes through the following process to select the best one:

  1. DFP iterates through each priority level, from 1 (highest priority) to 16 (lowest priority) looking for eligible line items.
  2. Within each priority level, line items are grouped based on their goal type, and they are served in the following order of preference until the line item's goal or cap is met:
    • Line items with percentage goals (a specific portion of traffic, or an exclusive sale)
    • Line items with absolute goals (impressions or clicks)
    • Line items that are unlimited (non-guaranteed, with a click or impression cap)
In some instances, DFP considers other factors such as pCTR, Ad Exchange revenue, and dynamic allocation over the line item priority, to select line items that optimize a publisher's yield.

To simplify the process of picking priorities and goals, DFP has eight predefined line item types from which you can choose:

Line item type Priority Goal
Sponsorship 4 percentage
Standard - high 6 absolute
Standard - normal (DEFAULT) 8 absolute
Standard - low 10 absolute
Network 12 percentage
Bulk 12 absolute
Price priority 12 unlimited
House 16 percentage

If your network is enabled for dynamic allocation, DFP optimizes the distribution of Ad Exchange and AdSense impressions throughout goal-based line item delivery, without compromising reservation goals. Specifically, with dynamic allocation, DFP considers standard line items and remnant line items that can serve to an eligible impression. It then makes its selection based on the higher of the CPM of eligible remnant line items or a calculated opportunity cost of line items with delivery goals.

If an Ad Exchange or AdSense line item isn’t eligible to serve, DFP uses priority and line item type to choose the best ad to serve. 

The ad selection process varies by line item goal type:

4.1. Percentage line items

Percentage (a value between 1% and 100%) is defined as the percent of targeted traffic not taken by a line item at a higher priority level. Percentage line items can be of sponsorship, network, or house type. For example:

Case one: equal priority, same percentages

  • Line item A: Targets 50% of Men in California — booked at priority 4
  • Line item B: Targets 50% of Men in US — booked at priority 4
  • The ad server adjusts so that each line item can meet its goal.

Case two: equal priority, different percentages

  • Line item A: Targets 50% of Women in New York — booked at priority 4
  • Line item B: Targets 25% of Women in New York — booked at priority 4
  • Line item A gets 50% of traffic, Line item B gets 25%; other line items at a lower priority take the remaining 25%.

Percentages can add up to more than 100%; this is called overweighting. When line items at the same priority total more than 100%, the ad server serves the line items in the correct proportion to each other, but each line item is likely to deliver less than its booked percentage. In general, overweighting is not advised as it can lead to this type of unexpected delivery. When choosing between percentage line items at the same priority, the following logic is used:

Case one: Total percentage of line items exceeds 100% (overweighted)

  • Line item A: Percentage=50%
  • Line item B: Percentage=50%
  • Line item C: Percentage=50%
  • 1/3 serve Line item A, 1/3 serve Line item B, 1/3 serve Line item C

These line items are overweight (150%) and are not able to meet their goals of 50% each. However, they do serve evenly.

Case two: Total percentage of line items is less than 100%

  • Line item A: Percentage=25%
  • Line item B: Percentage=50%
  • 1/4 serve Line item A, 1/2 serve Line item B, 1/4 fall through to absolute or unlimited line items at this priority, or else to the next priority level.
4.2. Absolute goal line items

Absolute goal line items (standard high, medium, and low, along with bulk) are line items that are booked to meet impression or click goals. Since these line items have a goal and a duration, DFP is able to calculate a delivery schedule such that the line item meets the delivery goals within its serving lifetime. These line items are chosen in a two-step process:

  1. Filter out line items that are running ahead of the target delivery schedule.
  2. Of the line items that pass the filtering stage, choose the best candidate line item.

Filtering is based on satisfaction index (SI), a measure of how far ahead or behind delivery schedule the line item is. Line items with absolute goals can be set to three possible delivery schedules:

  1. Even delivery: the ad server allows the line item to serve up to 5% "ahead" of the delivery schedule. However, if your network is enabled to use expected traffic shape in pacing, the delivery indicator may be higher than 105%, particularly early in a campaign. (Learn more about using expected traffic shape in pacing)
  2. Frontloaded: the ad server attempts to serve a line item ahead of schedule by as much as 25%.
  3. As fast as possible: the line item is never considered "on schedule" and serves an impression any time it is able to do so, unless another (equally-important) line item needs the impression more.
    More about "as fast as possible" line items:

    Unlike Even and Frontloaded line items, "As fast as possible" line items are never filtered from the list of line items that are eligible to compete based on SI. However, DFP still calculates an SI for these line items.

    If an "As fast as possible line item" is the only eligible candidate to serve, it always serves. If there are competing line items that are also eligible, they compete based on SI. This means that an "As fast as possible" line item never starves out an under-delivering even or frontloaded line item (at the same priority level).

    SI can also be affected if your network uses expected traffic shape in pacing. If traffic shape indicates an upcoming traffic trend, this information (sometimes called “hints”) is passed to the ad server, allowing it to adjust the delivery schedule to reflect the future trend. Hints about the shape of traffic can include trends such as low traffic on weekends or a bell curve of traffic over the course of a business day.

4.3. Unlimited line items

Unlimited line items (for example, price priority) have no goal, only a cap that limits the number of impressions or clicks the line item can receive either per day or over its lifetime. Unlimited line items are non-guaranteed because they are only considered for serving after the ad server has exhausted all percentage or absolute goal line items at the same or higher priority. If unlimited line items are being considered, the ad server chooses the line item with the highest effective CPM (eCPM), calculated in the following way:

  1. For CPM pricing, eCPM = CPM price
  2. For CPC pricing, eCPM = CPC price * historical average click-through rate * 1,000 impressions
  3. If AdSense dynamic allocation is turned on for the ad unit in the request, AdSense's eCPM = the combined value of all the line items that AdSense would serve to this ad unit that won the AdSense auction, following all normal AdSense rules. For example, if Adsense is competing for a skyscraper and would fill the slot with five text ad units, the eCPM would be the value of the winning bid for all five line items together.

If there is more than one price priority line item at the same cost, the line items rotate evenly.

If there are no line items available, including house line items, nothing serves (there are no system default line items). Unfilled impressions are tracked in your inventory reports. Learn more about unfilled impressions

5. The best creative is selected

Once the best line item is selected, the DFP ad server chooses the best creative:

  1. Creatives that don’t match the size of the ad request are filtered out.
  2. Only creatives of a valid type for that slot based on format (image, video, and so on) are considered.
  3. If a creative from a line item has already shown in this page view, it’s excluded from serving to other slots on the page. This prevents "jackpotting," where the same creative serves to all the slots on the page.
  4. At the end of filtering:
    1. If the line item contains only one matching creative, it’s served.
    2. If the line item contains no matching creatives, the ad server moves to the next best line item and repeats this process.
    3. If the line item contains more than one matching creative, creative rotation rules come into play:
      • Evenly: Rotate creatives evenly
      • Optimized: Choose the creative with the highest historical click-through rate.
      • Weighted: Choose a creative at random, but according to the relative weights specified for each (such as 70/30).
      • Sequential: Rotate creatives in the order specified, with each creative being numbered between 1 and 80. When creatives rotate sequentially, each user sees creatives in the specified order any time the line item is served to them — even across multiple page views. Serving sequence wraps around from the last creative to the first.

6. The creative is served

This is the final step of the ad selection process. At this point, DFP has selected the creatives to serve for all the ad slots that are part of the HTTP request. DFP records information about the winning ads for delivery reporting purposes, then constructs an HTTP response containing the creative code, and replies to the original HTTP request.

The GPT tagging library (on web and mobile web) or ads SDK (on mobile apps) receives the response and processes it. In the case of a GPT SRA request, this involves matching the specific creatives to the appropriate ad slots on the page. When the creative is added to the slot, any additional resources (for example, external images or scripts) are also downloaded and rendered. Ad serving is complete.

Was this article helpful?
How can we improve it?