In order to target ads to a specific sponsored page using DFP, you will need to pass the sponsored page key (skey) that is contained in the URL to DFP as a key-value.
Before we begin, you must have a DFP order, line item, and ad unit setup that will deliver the DFP creative to your Sponsored Page.
1. Append setTargeting parameter to GPT Header code
Append the following to your googletag.defineSlot definition found in the GPT Header code. This will grab the sponsored page's unique skey from the URL and pass it to DFP.
.setTargeting("skey", (window.location.search.match(/skey=(\w+)/) || [,'']));
2. Create new key/value
In DFP, navigate to the Inventory tab, and select Key-values from the left-hand menu. This step will let DFP know that we will be passing a new targeting key named 'skey' to the page.
Please ensure you select 'Users will enter targeting values when creating line items or checking inventory' for Values Type.
3. Target your line item to a specific Sponsored Page
From your line item setup, select the Key-values and Audience tab in the targeting section. Enter the Key Value name you just created in the Key-Values section.
Enter the specific sponsored page key you want to target.
Once this is completed, you should now see DFP creatives render on your Sponsored Page. If you are experiencing issues, please contact email@example.com for technical assistance.
Click here for more information on key-value targeting.