When you add key-values, you'll need to understand the difference between predefined and dynamic key-values.
- Predefined key-values: keys and their values are static and don't change based information of a particular user.
- Dynamic key-values: use a defined key but take dynamic values based on user attributes or behavior. Use dynamic targeting if you don't want to define key values in advance.
Predefined key-values
Use predefined key-values when you know the possible range of values.
For example, create the predefined key "age", and enter ranges as values—such as, "18-32", "33-42", and so forth. When you add the line item, select "age" as the key and "18-32" as the value. The key-value remains hard-coded in the ad tag.
Most publishers believe it's good practice to use less identifiable key-values strings in ad tags. Learn more in Names versus display names.
Dynamic key-values
Dynamic key-values let you pass targeting values dynamically into an ad tag based on information you collect.
For example, you can use dynamic key-values to target ads based on a user's search terms on your site. With dynamic targeting, you can have thousands of possible targeting values without defining each one ahead of time.
Example of dynamic key-values
Target line items to specific content and ad slots. If you want to target specific pages on your site, create a dynamic key named "pageID". Add pageID=123456
to the page's ad tags and then target your line item to that key-value.
You might also use key-values to target ads to specific ad slot positions. If you sell your ad slots above the fold at a premium, create a pre-defined key called "position" with multiple values, such as "top", "right-box", and "bottom". Add the key and value combination to your ad tags (position=top
) and target certain line items to that key-value so they don't appear below the fold.