Define and target custom criteria

To target custom criteria, you first need to define them on the Inventory tab.


Define custom criteria key-values

To create custom targeting criteria:

  1. Click the Inventory tab, then click Custom Targeting on the left-hand panel.

  2. Click New key.

  3. Enter the name that will be used in the ad tag for your targeting key in the Name box.

  4. Enter the name that your traffickers will see when they're targeting key-values in the Display name box.

    You may want a different display name if you're going to encode your key-values.

    Example encoded key-value

    You might use encoded key-values in your ad tag if you don't want visitors to worry about the information that's passed in the tag. For example, if you're targeting females, you would use the encoded key-value g=f in the ad tag. To make it easier for traffickers to find this key-value in DFP, you can assign the display name 'gender=female' to the key-value.

  5. Select whether you will enter targeting values when creating line items or predefine your targeting values.

  6. Click Add values, enter the targeting values, separated by line breaks, and click Apply.

    These values will be used in the ad tag.

    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.

  7. To enter names that your traffickers will see when they're selecting targeting values, click the Display name column next to the targeting value. Enter the display name in the box that displays and click Apply.

  8. Click Save.
You can quickly edit display names directly on the 'Custom targeting' page of the 'Inventory' tab. Just click a display name, make your changes, and click Save.

Format key names and values

  • Casing: Neither keys nor values are case-sensitive.

  • Maximum characters allowed: Key names can contain up to 10 characters each, and values can contain up to 40 characters each.

  • Maximum keys and values allowed: DFP Small Business supports up to 20 custom targeting key names. Each key name can contain up to 200 values. For example, you might call the first of your 20 key names age and define four (out of the 200) values as follows: 13-18, 19-34, 35-50, and 50.

  • Multiple values per page: You can pass multiple values per page.

  • Data type of values: Values are not data-specific; all values are treated as strings. For example, instead of using age >= 18 AND <34, try 18-34.

  • Numeric prefix: Key names cannot be prefixed with a number.

  • Key names invalid characters: You can't use the following characters when you create custom targeting key names:

    " (double quotes)
    ' (apostrophe)
    = (equal sign)
    ! (exclamation point)
    + (plus sign)
    # (pound sign)
    * (asterisk)
    ~ (tilde)
    ; (semicolon)
    ^ (caret)
    () (parentheses)
    < > (angle brackets)
    [ ] (square brackets)
    , (comma)
    . (period)
    & (ampersand)
    Spaces: You can't use spaces in the key of a targeting criterion. For example, sports car=porsche is not valid. You can, however, use spaces in the value. For example, car=red porsche is valid.

Use different match types

You can use different match types to more broadly target line items to search terms and other dynamic criteria.

  • "Include" match

    The line item is eligible when at least one of the words in a value in the ad tag matches line item’s targeted value. You can enable "include" matching by using a tilde (~) in the line item’s targeting value. The tilde (~) must always be placed at the beginning of the targeting value.

    Example: If you target your line item to search=~honda, that line item would be eligible any time a user's search includes the word honda. This line item would deliver to users who search for the terms honda civic, i want a honda, how much is a honda?, and honda safety. The line item would not deliver to users who search for civic or bmw.

  • "Begins with" match

    The line item is eligible when the first few characters in a value in the ad tag exactly match all of the characters preceding the asterisk in the line item’s targeted value. "begins with" match is enabled when the line item’s targeting value ends with an asterisk (*). The asterisk must be placed at the end of the targeting value.

    Example: If you target your line item to search=honda*, your line item will be eligible any time a user's search has honda as the first word in their search term, but they can have additional words after honda. This line item would deliver to users who search for the terms honda civic and honda safety. The line item would not deliver to users who search for i want a honda or how much is a honda?.

  • "Include" and "begins with" match combination

    You can use "include" and "begins with" matching together. The line item is eligible when a value in the ad tag contains at least one word that matches the line item’s targeted value that begins with a tilde (~) and at least one word that contains the characters in the value that precedes an asterisk (*). The valid formats of an include and "begins with" match is: key=~value* and key=~value or values*.

    Example: If you target your line item to search=~honda civic*, that line item can show any time a user includes honda in their search along with a word that begins with the characters, civic. This line item would deliver to users who search for buying honda civic and price civics honda. The line item would NOT deliver to a user who searches for honda odyssey or civic.

  • "Any" match to target all values

    To target all the values of a key, you can use "any" matching. "Any" matching is enabled when the line item’s targeting value only includes the asterisk (*). The line item is delivered to any ad tag that matches the key, regardless of what targeting value is passed to the ad tag.

    Example: If you target your line item to car=*, that line item can deliver to any tag on your website that has a key-value with car as the key. It can deliver to tags with car=honda, car=bmw, or car=ford. It can’t deliver to sport=baseball or content=car.

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 includes the word honda.

The above example is of an "include" match, but you can use "begins with" match and "any" match to target key-values that aren't search terms as well.

Advanced expressions

For advanced users who want to create complex custom targeting expressions, you can click advanced expression and enter or paste a regular expression containing your custom targeting. The key names must match key names that have been created in DFP, and the values must be either defined values or free-form values that have already been passed to the ad server at least once. When you're done, click Process expression.

To create an expression, you can use the following operators:

= (equals)
!= (is not)
( ) (parentheses to group items)
, (or)
and (and)

Example expression:  

(age=13-20, age=40-50) AND (income=10k, income=20k) AND status!=member

Target custom criteria

Target custom criteria the same way you target all other criteria, on the Settings tab of a line item.


Delete custom criteria

To delete custom criteria, 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. Once a key is created, you can't edit the key or delete and recreate it with a different casing. If you recreate a previously deleted key, DFP reuses the previous key’s casing.

Let's say that there is an existing pre-defined key gender with values female and male. Deleting the key makes it inactive, and all the values (female, male) will become inactive as well. If a new key called Gender is created, either as a free-form or a predefined key, when the user tries to target a line item to custom criteria, the drop-down menu will show the key name gender rather than Gender. However, because custom criteria in DFP are not case-sensitive, this will have no impact.

Training: Check out the DFP Inventory Fundamentals training module.