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.
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.
- Login to DFP small business
- Click on the Inventory tab found at the
- Click on the custom Targeting link on the left
- Click on the New Key button
- Enter the name of your key value pair. This will used for setting the custom targeted code
- 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:
= (equal sign)
! (exclamation point)
+ (plus sign)
# (pound sign)
< > (angle brackets)
[ ] (square brackets)
- 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.
- 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.
- In our example we are tagging a page manually with an Age ID so we would select “Users will select from predefined targeting values.”
- Click on the “Add Values” button.
- 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”.
- 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:
- 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.
- Locate the appropriate line item in DFP Small Business.
- Click on the “Settings” tab.
- Click on the “Custom Criteria” tab.
- Type in your Key Value Pair, DFP should find it for you. Select it and click the “Add Key” button.
- 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.