Friday, March 30, 2012

Setting up Custom Criteria/Key Value Pair Targeting in DFP Small Business

I've been asked a few times recently about how to setup custom criteria in DFP small business so I thought I would compile the below tutorial. Follow the instructions below to setup Custom Criteria/Key Value Pair targeting in DFP Small business:

In this example we want to add a key value pair to a particular page to allow us to target ads specifically to that page in DFP Small business. We will use pageid=123 in our example.

1. Login to DFP Small Business.

2. Click on the "Inventory" tab found at the top left of the screen.



3. Click on the "Custom Targeting" link on the left.



4. Click on the "New Key" button.



5. Enter the "Name" of your key value pair. this would be the key portion. Example: PageID=123
PageID would be the name.



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 18-34.="" br="" try="">
• 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.

6. 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 ID so we would select "Users will select from predefined targeting values."

7. Click on the "Add Values" button.



8. Enter your "Values" in the text box. We would add 123 in our example. Remember to only enter one value per line up to 500 values at a time. Click apply to save your "Values".



9. To add the Key Value Pair to the page we want to target we need to add the following:

<script type='text/javascript'>
GA_googleAddAttr("pageid", "123");
</script>

This needs to be added to the DFP head call already in place on the page. Like so:

<script type='text/javascript'>
GS_googleAddAdSenseService("ca-pub-123456789101112");
GS_googleEnableAllServices();
</script>
<script type="text/javascript">
GA_googleAddAttr("pageid", "123");
</script>
<script type="text/javascript">
GA_googleAddSlot("ca-pub-123456789101112", "Test_com_Top_728x90");
</script>
<script type="text/javascript">
GA_googleFetchAds();
</script>

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.

10. Locate the appropriate line item in DFP Small Business.

11. Click on the "Settings" tab.



12. Click on the "Custom Criteria" tab.



13. Type in your Key Value Pair, DFP should find it for you. Select it and click the "Add Key" button.

14. Save your changes to the line item, click the "Save" button at the bottom of the page.

Congratulations! You have completed setting up Custom Criteria/Key Value Pair targeting for DFP Small Business!

1 comment:

  1. Just curious where you are generating the DFP head call code, I've seen this format before, but I can't seem to duplicate it from within DFP itself.

    ReplyDelete