- Open Source
- APIs
- Advertising
- Blog
- Events
- Podcasts
- Apps
- Native
- Documentation
- Yahoo Native to Yahoo DSP API Migration Guide
- Sign In
- Language:
Targeting Attributes¶
The attached (downloadable) Zip file contains 5 code snippets demonstrating how to read various targeting attributes and types from Native (Gemini) and write those attributes and types to the DSP platform.
You can download all 5 code snippets by clicking Targeting Java code snippets
.
Java Code Snippets¶
Examples 1 and 2 are used to represent the domain model when reading targeting attributes and types from Gemini and writing them to DSP.
Example 3 shows how to make a GET call to fetch specific campaign level targeting attributes, and flatten Gemini campaign and ad group targeting into DSP’s line level targeting.
Examples 4 and 5 show where the main mapping logic resides when you migrate device targeting and ad scheduling attributes, as well as location, age, gender and segment targeting attributes to DSP.
For instance, once you filter out all device types values: smartphione, desktop, tablet, you then create a payload of a DSP entity, which is a targeting type set as device.
Example |
Java code |
Demonstrates |
---|---|---|
Example 1 |
|
Shows a class that represents a Gemini targeting attribute. |
Example 2 |
|
Defines enumerations to represent Gemini targeting types, which include DEVICE, DAY_TIME, LOCATION, AGE, GENDER, and SEGMENT. |
Example 3 |
|
How to flatten Gemini campaign and adGroup hierarchical targeting into DSP’s line level targeting. Note that lower-level targeting takes precedence for each type of targeting, i.e. ad group targeting comes first. |
Example 4 |
|
How to migrate device targeting and ad scheduling from Gemini to the DSP platform for device targeting and day parting targeting. Also shows how to generate DSP device targeting according to a bid multiplier if it is a valid case. Only when |
Example 5 |
|
How to migrate WOEID (location), age, gender and segment targeting from Gemini to DSP platform targeting. |