ePublishing Knowledge BaseePublishing Knowledge BaseePublishing Knowledge Base AdvertisingDFP/Google Ads Manager - Key-value Ads Targeting Implementation

DFP/Google Ads Manager - Key-value Ads Targeting Implementation

Why Key Value Targeting?

Setting your site up with the ability to deliver specific ads is a powerful tool. Using Key-value targeting is a sophisticated tool to directly control which ads are delivered on specific pages, such as a topic page. 

Standard Key-values Supported for Targeting

  • id - This allows targeting on page id (Example: /articles/id-seo-friendly-url = id). 
  • keyword -  This allows targeting based on keywords assigned to content (Example: /keywords/food = food). 
  • page_name - This allows targeting based on the the page name which is the end of the URL. (Example: https://demo.epublishing.com/topics/144-career-advice would have a page_name value of “114-career-advice”).
  • page_type - This allows targeting based on the type of interior page such as a topic landing page, articles, or gallery.
  • reg_user (true or false) -  This allows targeting based on whether or not a user is logged in.
  • search_terms - This allows targeting based on search terms and is typically only populated on search results pages.
  • tags - This allows targeting based on tags (taxonomy tags).
  • taxonomy - This allows targeting based on taxonomy name (value is typically identical to tags). 
  • taxonomy_id - This allows targeting based on the taxonomy id (Example: /topics/114-career-advice = 114). 
  • url - This allows targeting based on the URL.

For DFP (aka Google Ads Manager) the Initial Setup of Key-values:

Go to https://admanager.google.com  with login credentials for your site.

Follow the steps below:

  1. Click Inventory in the left side bar menu:


  1. Click Key-values to access the Key-values screen. 

  1. Click the New Key button on the Key-values screen. 

  1. Enter Key-value* information based on the parameters necessary for that Key-value, then click the Save button. Example: reg_user has the following parameters:

Name = reg_user

Display name = reg_user

Value type = Free-form

Report on values = On

Make a dimension = No

In order for targeting to work, you can only setup the key-values listed at top of this KB article. 

For DFP/Google Ads Manager - Line Item Targeting

Once your desired Key-values are set up you can use them to deliver ads via Line Items.

Select the Line items option under the Delivery Menu


Click the Line Item link from the list of ‘Line Items’ you have previously created (Example: Feb 2019 Targeting Demo)


Once you have the Line Item open that you want to update with Key-value targeting, scroll down the page to the ‘Add targeting’ section. Select Key-values from the list of targeting options at the left.

Note: You can click the ‘Add key’ link to get the drop down of available Key-values


Select the Key-value you wish to use (Example: url)

Select the relationship type is or is not (Example: is)

Select the value its desired value (Example: /topics/143-hr-strategies).  

Be sure to click the Save button to save your changes, your new Key-value will appear in the right side under Selected Criteria when it is saved properly.

(Example: url (url) is /topics/143-hr-strategies)


Now that particular creative associated with the line item will run on pages where the Key-value expression is accurate (example url = /topics/143-hr-strategies). 


Be sure that your Ad Units and Orders are set up appropriately, a Knowledge Base article on how to do that is here.

To make your ads appear exclusively on the pages you are targeting and have no other ads render, you will need to add the opposing expression to all Line Items that utilize the same ad unit.

Under Add targeting section for other Line Items using the same ad unit, go to Key-values

Add Key with the opposite expression (is not) to the Selected Criteria and click Save (Example: url (url) is not /topics/143-hr-strategies)

Again, be sure that your Ad Units and Orders are set up appropriately, a Knowledge Base article on how to do that is here.

How do I find the specific Key-values for a given page on my site?

Important Note: Find the key-values for a given page on your site by using your browsers Development Tools ‘Inspect Element’ or ‘Inspect’ Option and going to the ‘Console’ Tab.

You simply go to the page you want to see the key-values for, right click and select Inspect. Then click on the 'Console' tab. 

Firefox Example:

Chrome Example: