Ad selection white paper

Watch related Publisher University training

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.

Help me troubleshoot delivery

Notes and definitions

  • In the context of this document, we refer to HTTPS as the protocol used in ad serving. DFP now fully supports HTTPS, as Google has moved 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 HTTPS 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:

Ad selection process infographic

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.
    • When AdX or AdSense is eligible, DFP uses dynamic allocation to check 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 or RTB demand.
  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 and yield groups is created

Once the ad server gathers the relevant information for the ad request, it generates a list of all line items and yield groups 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 or yield group targeting Men in California is on the list.
  • A line item or yield group targeting Men in California on Windows is not on the list.
  • A line item or yield group targeting Men in Vermont is not on the list.
About inventory matching: The ad server considers all line items/yield groups 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. If an Ad Exchange line item or yield group is eligible to compete, dynamic allocation ranks all eligible remnant and Ad Exchange line items by their value CPM. DFP chooses the highest value remnant line item to compete with the temporary CPM calculated for guaranteed line items. Learn more about dynamic allocation
In some instances, DFP considers other factors such as CTR, Ad Exchange revenue to select line items that optimize a publisher's yield.

Using dynamic allocation, DFP optimizes the distribution of remnant inventory (including Ad Exchange, exchange bidding, mediation, and others) against 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.

When considering guaranteed and remnant line items with dynamic allocation, DFP takes the following into consideration:

  • Remnant line items are those that are in the remnant space, defined as line items in a given auction that are equal to or a lower priority than the highest of:
    • Priority 12
    • 1 greater (numerically) than the highest priority (numerically lower) Ad Exchange, AdSense, or Price Priority line item
  • Guaranteed line items are those that are not in the remnant space.

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

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?