building an ad platform with dfp


Since DFP lets ads compete in real-time with one other for highest-paying placements, and because there are so many criteria involved in deciding which ad wins a placement on any given page load, you can imagine that the algorithms involved can become extraordinarily complex. Trying to figure out why a given ad did or did not "win" this real-time competition can be tricky.

Fortunately, DFP provides a "debug" mode which can help you figure out exactly what DFP was thinking on a particular page load. To activate debug mode, just append the parameter ?google_debug to the end of your URL. For example, if the page you're looking at is:

then make the URL read:

If there's already a question mark in the URL, use standard URL parameter technique to add the parameter. For example, if you already have:

then use:

Enable Pop-Ups

You'll need to enable popups in order for anything to happen - most modern browsers block popups by default, and all provide the options to selectively allow them in different places.

Google Chrome: Click the small box with the red X in the OmniBar, then click the Loading link.

Apple Safari: Pull down the main Safari menu and disable the option "Block Pop-Up Windows."

Mozilla Firefox: In the yellow bar that appears at the top of the browser window, click Preferences, then select "Allow pop-ups for"

The DFP debug window will pop up, and present you with a long list of technical stuff. At the top of the window, you'll see a list of Ad Units (Ad Slots) that were invoked on the current page. To the right of each, you'll see a Details link. Click the one you're curious about.

At the top of the resulting window, you'll see the Winning Line Item, followed by a list of Rejected Line Items and the reasons for their rejection.

In this example, we see that one line item was rejected for being of a "lower priority" (it was selling for $20/day, while the winning item was $50/day). We also see another line item rejected for the dreaded catch-all reason "No active right-sized creative associated." Remember, this message doesn't necessarily mean your ad art is of the wrong size - it could mean almost anything. In many cases, items in this bucket are rejected because they're still in Draft mode, or because their inventory has been released, or because they have a $0 CPM associated with them, or other reasons.

You may still need to do a bit of sleuthing to figure out exactly why line items get rejected, but debug mode will generally put you on the right track.