Setting up custom targeting in DFP for small business


Custom targeting is a very useful for show Ads based on certain criteria. Let’s take an example of a website who wants to show an Ad to user between age of 0-18 and another Ad to user between age of 21-50 by using same Ad unit.

By using the custom targeting you can define your own targeting criteria (such as age, gender, or content) that DFP Small Business wouldn’t otherwise be able to determine.

Some thanks

Before we begin, this blog post, technique and concept was born from collaboration. There are a number of people that need to be recognized for contributing.

Vishakha Bajaj – UX Director at Experience Commerce a Full service Digital Agency

Below is the step by step guide for setting up the custom targeting on your website.

  1. Login to DFP small business
  2. Click on the Inventory tab found at the
    DFP small business - Inventory tab
  3. Click on the custom Targeting link on the left
    DFP Small business - Custom targeting
  4. Click on the New Key button
    DoubleClick for Publishers   Custom targeting new key
  5. Enter the name of your key value pair. This will used for setting the custom targeted code
    Eg: Age
    DFP   Custom targeting
  6. Keep in mind the following restrictions when creating your key value pairs:
    • 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 six (out of the 200) values as follows: 1-5, 6-11, 12-18, 19-34, 35-50, and 50.
    • Maximum 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.
    • 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.
  7. Select the “Values Type”. Your two options are:
    Users will enter targeting values when creating line items or checking inventory.
    Users will select from predefined targeting values.
  8. In our example we are tagging a page manually with an Age ID so we would select “Users will select from predefined targeting values.”
  9. Click on the “Add Values” button.
  10. Enter your “Values” in the text box. We would add 0-24 in our example. Remember to only enter one value per line up to 500 values at a time. Click apply to save your “Values”.
  11. To add the Key Value Pair to the page we want to target we need to update the code with .setTargeting
    This needs to be added to the DFP head code already in place on the page. Like so:

    <script>googletag.cmd.push(function(){googletag.defineSlot(‘/34223877/Top’,[215,224],’div-gpt-ad-xxxxxxxxx-0′).addService(googletag.pubads());googletag.defineSlot(‘/34223877/Bottom’,[295,204],’div-gpt-ad-xxxxxxx-0′).addService(googletag.pubads());googletag.pubads().setTargeting(“age”,”0-24″);googletag.pubads().enableSingleRequest();googletag.enableServices();});</script>

  12. Now that we have created the Key Value Pair and added it to the page we want to target, we want to add the targeting to an existing campaign.
  13. Locate the appropriate line item in DFP Small Business.
  14. Click on the “Settings” tab.
  15. Click on the “Custom Criteria” tab.
  16. Type in your Key Value Pair, DFP should find it for you. Select it and click the “Add Key” button.
    DoubleClick for Publishers   Line item detail
  17. Save your changes to the line item, click the “Save” button at the bottom of the page.

Now you have completed setting up Custom Criteria/Key Value Pair targeting for DFP Small Business!
Please let me know your suggestion/clarification in the comments.

Advertisements

One thought on “Setting up custom targeting in DFP for small business

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s