Native List Targeting
  • 4 Minutes to read

    Native List Targeting


      Article summary

      This article describes resources that enable you to add and update native list targeting rules.

      Overview

      A native list is a list of sites or apps that you can apply to targeting rules for Yahoo native lines. To learn about defining and managing native lists, refer to Yahoo Native Lists.

      Note: Yahoo DSP API currently only supports targeting rules that block a native list, so plan your native lists accordingly.

      Resources

      The following sections list the nativeLists and nativeList resources respectively.

      nativeLists resources

      Use the nativeLists object to add, remove, or clear all native list targeting for a Yahoo native line.

      To add targeting rules based on native lists, there should be one or more native lists available under the advertiser. If there aren’t any, use the Native List resource to define one. Refer to Yahoo Native Lists.

      Field

      Description

      Data Type

      Required

      added

      A list of nativeLists to add to line targeting.

      Array<nativeList>

      N

      removed

      A list of nativeLists to remove from line targeting.

      Array<Long>

      N

      clearAll

      If set, all nativeList targeting rules on the line are cleared.

      Boolean

      N

      nativeList Resources

      Use the nativeList object to exclude the apps and sites on the native list from line targeting for the specified line.

      When reading (GET) line targeting rules, targeted native lists are represented by an array of nativeList objects called nativeListsExcluded. It’s suffixed “excluded” because Yahoo native lines currently only support exclusion (blocking) of native lists in targeting.

      Field

      Description

      Data Type

      Required

      excluded

      If set, the native list the targeting rule excludes (blocks) the items (apps and/or websites) on the native list. Must be set to true because Yahoo native lines currently only support exclusion rules.

      Boolean

      Y

      entityId

      A unique identifier for the native list to target (block).

      Long

      Y

      Add and Update

      To enable Native List targeting, add the nativeLists array to the line targeting POST request.

      As a prerequisite, you first need to get a valid NativeList id to pass as the entityId in the request payload. To get the list of available native list ids for a given account, use the Search method in the Yahoo Native Lists resource.

      The nativeListsExcluded object supports partial updates. To update the nativeListsExcluded in the line targeting rules, you can send a POST request with just the new native lists to be added in the nativeLists.added array.

      Example Request

      POST /traffic/lines/2222/targeting HTTP/1.1
      Host: <HOST_NAME>
      Content-Type: application/json
      Accept: application/json
      X-Auth-Method: OAuth2
      X-Auth-Token: <ACCESS_TOKEN>
      
      
      {
        "nativeLists": {
            "added": [
               {
                   "excluded": true,
                   "entityId": 5
               }
            ]
        },
        "types": [
               {
                   "name": "NATIVE_LIST",
                   "isTargeted": true
               }
        ]
      }

      Example Response

      {
          "response": {
              "nativeListsExcluded":
                  {
                      "id": 5,
                      "name": "HappyMedium Native List 1",
                      "createdAt": "2020-02-10T14:50:16Z",
                      "updatedAt": "2020-02-10T14:52:34Z"
                  }
              ],
              "types": [
                  {
                      "isTargeted": true,
                      "name": "NATIVE_LIST"
                  }
              ],
          },
          "errors": null,
          "timeStamp": "2020-02-11T03:07:01.817Z"
      }

      Note

      The response is shortened to show only the relevant parts.

      Remove One or More

      To stop excluding a native from line targeting (i.e. remove an excluded native list from line targeting), make a POST request on the line targeting endpoint by including the Native List ID you want to remove in the nativeLists.removed attribute.

      First make a GET call to find the native list ID that you’re currently targeting.

      Setting the isTargeted attribute of NATIVE_LIST type to true or false has no effect. When all nativeLists are removed from targeting, the Native List targeting is considered disabled, and isTargeted is automatically false.

      Example Request

      POST /traffic/lines/2222/targeting HTTP/1.1
      Host: <HOST_NAME>
      Content-Type: application/json
      Accept: application/json
      X-Auth-Method: OAuth2
      X-Auth-Token: <ACCESS_TOKEN>
      
      
      {
        "nativeLists": {
            "added": [],
            "removed": [5]
        },
        "types": [
            {
                "name": "NATIVE_LIST",
                "isTargeted": true
            }
        ]
      }

      Example Response

      {
          "response": {
              "types": [
                  {
                   "isTargeted": false,
                   "name": "NATIVE_LIST"
                  }
              ]
          },
          "errors": null,
          "timeStamp": "2020-02-11T03:07:01.817Z"
      }

      Note

      The response is shortened to show only the relevant parts.

      Remove All

      Setting clearAll on a nativeLists object to false or setting the NATIVE_LIST isTargeted attribute to false removes all targeted native lists and disables native list targeting.

      While it may be tempting to use clearAll instead of a GET and remove (because Yahoo DSP API currently only supports targeting one native list), Yahoo may support targeting additional native lists in the future. In that case, by setting clearAll, you may inadvertently remove native lists you want to keep. Yahoo recommends that you reserve the use of the clearAll object for a future time when multiple native lists are supported and you want to remove all of them.

      Example Request

      POST /traffic/lines/2222/targeting HTTP/1.1
      Host: <HOST_NAME>
      Content-Type: application/json
      Accept: application/json
      X-Auth-Method: OAuth2
      X-Auth-Token: <ACCESS_TOKEN>
      
      {
        "nativeLists": {
            "clearAll": true
        },
        "types": [
            {
                "name": "NATIVE_LIST",
                "isTargeted": false
            }
        ]
      }

      Example Response

      {
          "response": {
              "types": [
                  {
                     "isTargeted": false,
                     "name": "NATIVE_LIST"
                  }
              ]
          },
          "errors": null,
          "timeStamp": "2020-02-11T03:07:01.817Z"
      }

      Note

      The response is shortened to show only the relevant parts.


      Was this article helpful?