- 3 Minutes to read
Contextuals Targeting
- 3 Minutes to read
This article describes resources that enable you to read and define contextual targeting.
Overview
If you have created contextuals for an advertiser, you can set up targeting to serve or exclude ads based on the contextual.
The Yahoo DSP supports CONTEXTUALS targeting for lines serving display and video ads.
To learn more, refer to Contextuals.
Endpoint
/traffic/lines/{id}/targetingA
GETrequest enables you to view contextuals targeted by the specified line.A
POSTrequest enables you to target contextuals with the specified line.
Resources
Targeting
The targeting resource is the standard Yahoo DSP resource for targeting consumers based on their profiles, behaviors, and ad content.
The targeting resource is defined by the following CONTEXTUALS targeting type-specific fields:
Parameter | Parameter Type | Definition | Data Type | Required |
|---|---|---|---|---|
| path | Specifies the line ID. |
| Y |
| body | Specifies contextuals to target or exclude from targeting. To learn more, refer to Contextuals Payload Object. |
| Y |
| body | A read-only array that identifies contextuals targeted by the line. For detailed field reference, refer to Contextual. |
| N/A |
| body | A read-only array that identifies contextuals not targeted by the line. For detailed field reference, refer to Contextual. |
| N/A |
| body | Specifies an array of targeting types to update, enable, or disable.
To learn more, refer to Targeting Types. |
| Y |
Note
For a complete list of targeting resource fields, refer to Targeting Object.
Contextuals Payload Object
Field | Description | Data Type |
|---|---|---|
| Contextuals to add (either targeted or blocked). |
|
| Indicates if all existing targeted contextuals should be removed. By default,
|
|
| Contextual IDs to be removed from targeting. |
|
Contextual Item Object
Field | Description | Data Type |
|---|---|---|
| Specifies the ID number associated with the contextual. |
|
| Indicates whether the added contextual is to be excluded or included.
|
|
Read Targeting Contextuals
Get a list of contextuals that are available for targeting.
GET /traffic/targeting/contextuals?lineId={lineId}&taxonomyType={taxonomyType}&query={query}All of the accepted parameters are query parameters.
Parameters
Parameter | Description | Data Type | Required |
|---|---|---|---|
| Specifies the line ID. |
| Y |
| Specifies the taxonomy type.
|
| Y |
| Specifies the search term. Use URL encoding conventions (i.e. a space should be replaced with a |
| Y |
Sample Request URL
GET https://dspapi.admanagerplus.yahoo.com/traffic/targeting/contextuals?lineId=365277&taxonomyType=PUBLISHER_DECLARED&query=testSample Response
{
"response": [
{
"taxonomyType": "PUBLISHER_DECLARED",
"id": "43188",
"name": "contextual_update_test"
},
{
"taxonomyType": "PUBLISHER_DECLARED",
"id": "41843",
"name": "test-iab"
}
],
"errors": null,
"timeStamp": "2017-07-27T21:30:07Z"
}Add/Update Contextuals Targeting
Add or update contextual targets for the specified line.
POST traffic/lines/{id}/targeting/Parameters
The line ID is specified in the path of the URL. All other parameters are specified in the body of the application/json payload.
Sample Request URL
POST https://dspapi.admanagerplus.yahoo.com/traffic/lines/365277/targeting/Sample Request Body
{
"contextuals": {
"clearAll": false,
"added": [
{
"contextualId": 65733,
"excluded" : false
}
],
"removed": []
},
"types": [
{
"name": "CONTEXTUALS",
"isTargeted": true
}
]
}Sample Response
{
"response": {
"types": [
{
"name": "CONTEXTUALS",
"isTargeted": true
}
],
"contextualsIncluded": [
{
"id": 65733,
"accountId": 306442,
"name": "dv-abs",
"updatedAt": "2019-10-11T23:00:47Z",
"categories": [
{
"id": 184132,
"categoryId": 50571280
},
{
"id": 184131,
"categoryId": 50571278
}
],
"taxonomyType": "DOUBLE_VERIFY_AUTHENTIC_BRAND_SAFETY"
}
]
},
"errors": null,
"timeStamp": "2019-10-15T00:54:14.401Z"
}