building an ad platform with dfp

Define Your Inventory

It's time to start putting ads on pages of your staging site. Sign into DFP and click on the Admin tab. You'll see a panel on the left from which you can set up Contacts (people who will be allowed to log in and view reports and campaign progress), Companies (each ad must be attached to a company in the system for tracking purposes), and Network Settings, which you can use to set a name for your entire network of ads.

Once that's done, click the Inventory tab at the top, then Ad Units on the left. You can now tell DFP what Ad Unit spaces are available on your site. Let's start by defining a slot for your main ad - your "Leaderboard." Click New Ad Unit.

Start by giving the Ad Unit a name. It's important to use names that include all the information you'll need to identify it at a glance later on, including:

  • The name of the site
  • The section or page of your site
  • The ad unit's place on a page
  • The ad unit size

For example, these would be excellent Ad Unit names:

  • ABCProductsUnlimited_HelpCenter_FAQs_ATF_Left_90x90
  • ABCProductsUnlimited_HelpCenter_Tutorials_BTF_footer_728x90
  • ABCProductsUnlimited_Products_HotPick_ATF_skyscraper_90x728
  • MoreABCProducts_HelpCenter_FAQs_BTF_Right_90x90

(In these examples, ATF means "Above the Fold"). Ad Unit names cannot be longer than 100 characters. See Google's FAQ on ad unit naming for more information.

Call your leaderboard ad unit something like:

MySite_AllPages_ATF_Top_Leaderboard_728x90

Feel free to add an optional description if you want your advertisers to have more information about the unit. Select the actual ad dimensions from the Size drop-down.

Use the Target Window selector to control whether a clicked ad will be a normal link (_top) or will open in a new browser window or tab (_blank). When linking to other sites on the web, we strongly recommend not using "_blank". However, links to ads are a bit different from links to content, and setting "_blank" (new window or tab) is the norm for ad links on the web.

Ignore the Placements section for now.

Take a look at the bottom of the page, where it says "AdSense Inventory." By default, this is enabled, which means that AdSense ads will be served any time you don't have enough ad orders to match the actual traffic you're serving. Click the "Show" link to reveal Ad Type and color settings for any AdSense ads that end up being displayed.

Note: If you use AdSense as a fallback, it will only compete with non-guaranteed inventory and other ad networks. It won't compete with directly placed ads.

Important: Google only allows you to serve up to three AdSense ads on any given page. If you define more than three ad slots per page, you must turn AdSense off for some of them. Do this by clicking the Override link in this section.

Click Save at the bottom of the page. DFP may tell you that it's now time to create a Placement to run an ad. However, Placements are optional, and we're going to ignore them for now.

Repeat this process to define two more ad units. In this tutorial we'll assume you're working with one leaderboard, one rectangle at 180x150 at the top of your sidebar, and one larger (300x250) rectangle at the bottom of every article, but feel free to modify these sizes to match the needs of your own site.