Add and target DFP key-values

Define keys and values to target inventory

Key-values are used in DFP to target specific inventory. Learn more about how to design and create DFP inventory.

Add key-values in DFP

  1. Sign in to DoubleClick for Publishers.
  2. Click Inventory and then Key-values and then New key.
  3. Enter a Name to be used in the ad request. Example: pos
  4. Enter a Display name used by traffickers in DFP when targeting line items. Example: position
  5. Select Values type. Learn more
    • Free-form: Users will enter targeting values when creating line items or checking inventory.
    • Predefined: Users will select from predefined targeting values.
  6. Click Add values (optional).

    Enter targeting values, separated by line breaks, and click Apply. You can enter targeting values for both predefined and free-form keys. You may want to add values for free-form keys to suggest values to your traffickers while still allowing them to enter their own.

    Click the display name column next to each value to define a display names for DFP traffickers to use.

  7. Click Save.

Format keys and values

  • Neither keys nor values are case-sensitive.
  • Key names cannot be prefixed with a number.
  • All values are treated as strings. For example, instead of age >= 18 AND <= 34, age="18-34".
  • The following characters aren't allowed in key and value names:
    • " (double quotes)
    • ' (apostrophe)
    • = (equal sign)
    • ! (exclamation point)
    • + (plus sign)
    • # (pound sign)
    • * (asterisk)
    • ~ (tilde)
    • ; (semicolon)
    • ^ (caret)
    • () (parentheses)
    • < > (angle brackets)
    • [ ] (square brackets)
    • , (comma)
    • & (ampersand)
  • Spaces aren't allowed in a key name, but are allowed in value names. For example, sports car=porsche is not valid, but car=red porsche is valid.
  • Keys used in the pattern match macro and the video metadata macro only support alphanumeric characters and underscore (_).
  • A custom key within an audience segment only supports alphanumeric characters and underscore (_). Custom keys in audience segments must start with a non-numeric character. For example, abc123 is valid; 123abc is not. Learn more about audience segments   Not available in DFP Small Business.

Learn more about system maximums for characters, keys, and values.

Add key-values to your ad requests

Target key-values

Target key-values with line items the same way you target other criteria. Learn more about line item targeting

Match types

The "match types" and advanced expressions below describe how to target variations of key-values. Match types only apply to free-form key-values and are not supported by predefined key-values.

  • Exact match

    If you don't add any special modifiers to a targeted value, the user search must match it exactly. For example, if you target travel, travelers and travels don't match.

  • "Begins with" match

    Use an asterisk (*) at the end of a value to match items that begin with the value but have additional characters at the end. For example, travel* would match values like traveler and traveling, as well as travel the world, because these terms begin with travel. It would not match terms such as where to travel or fasttravel.

  • "Include" match

    Use a tilde (~) at the beginning of a value to include values that have the entire word in them, in any location. For example, ~travel would match values like adventure travel and travel insurance, but not travelers or travelers insurance.

  • "Begins with" and "include" match

    Now we're getting fancy. You can use both a tilde and an asterisk on a value: ~travel*. The "begins with" part of the value can now appear anywhere in the value, not just at the beginning. Our example would match travelers, luxury travelers, travel insurance, traveling penalty, but not re-travel.

  • Values with spaces

    When you're using match types, spaces are treated as characters within the value. For example, travel deal* would match travel deals and travel dealership, but not traveling deal.

Examples

Show examples of match types

The following tables give more examples of different match types. For each value on the left, you can see whether a series of search terms are considered matches. Terms that don't match are crossed out.

Single-word values

Match type Value Does the search term match?
Exact match car car car parts cartoon used car Madagascar
Begins with car* car car parts cartoon used car Madagascar
Include ~car car car parts cartoon used car Madagascar
Begins/include ~car* car car parts cartoon used car Madagascar

The following table gives examples of different match types for multi-word values.

Multi-word values

Match type Value Does the search term match?
Exact match new car new car new car buy new car new car smell new cartoon
Begins with new car* new car new car buy new car new car smell new cartoon
Include ~new car new car new car buy new car new car smell new cartoon
Begins/include ~new car* new car new car buy new car new car smell new cartoon

These match types can also be applied to key-values that aren't search terms.

In addition to using these match types for search terms and key-values that are dynamically passed to the ad tag (like demographic information about a user), you can use them in key-values that are hard-coded in the ad tag (like information about the content of the page).

For example, let's say you have a car website and you've made key-values for the make and model of cars that you feature on the site. You may have a key-value for car=hondacivic that is hard-coded in the ad tags on the pages of your site that discuss the Honda Civic. You may also have key-values for car=hondaaccord and car=hondainsight. If you want to target all the pages of your site that discuss Hondas, you could target a line item to car=honda* and that line item would show to any key-value that has a value that begins with the word honda.

The above example is of a "begins with" match, but you can also use other match types to target key-values that aren't search terms.

Advanced targeting expressions

After selecting a key to target with your line item, you can paste an advanced targeting expression into a text box. Use De Morgan's Laws to create various equivalents of advanced expressions.

Supported operators

= (equals)
!= (is not)
( ) (parentheses to group items)
, (or)
and (and)
" " (use quotation marks around spaces)

Examples

  • (age=13-20, age=40-50) AND (income=10k, income=20k) AND status!=member AND hobby="rock climbing"
  • NOT (playing AND eating) is equivalent to (NOT playing) OR (NOT eating).
  • NOT (soccer OR basketball) is equivalent to (NOT soccer) AND (NOT basketball).

To target audience segments when targeting inventory, click Key-values and audience, then select Audience segment from the drop-down. Enter a value or start typing and click a segment name as it appears in the list.

Deactivate key-values

To delete key-values, enable the checkbox next to the key name and click Delete. However, it may make more sense to think of this action as deactivating the key, rather than deleting it.

Learn about deactivating key-values.

Was this article helpful?
How can we improve it?