Day Parting Targeting

This article describes resources that enable you to read and define day parting targeting.

Overview

Day parting enables you to target ad placement opportunities during specific days of the week and hours of the day.

The days of the week and hours of the day targeted are specified in the dayParting object.

The Oath Ad Platforms DSP supports DAY_PARTING targeting for lines serving display and video ads. Day parting is not supported for lines serving native ads.

Endpoint

/traffic/lines/{id}/targeting
  • A GET request enables you to view day parting schedules targeted by the specified line.
  • A POST request enables you to target day parting schedules with the specified line.

Resources

Day Parting Object

The dayParting object defines the days of the week and hours of the day that are targeted by a specific line.

The dayParting object consists of seven array objects that represent the days of the week: sunday, monday, tuesday, wednesday, thursday, friday, saturday. Each day-of-the-week array specifies the hours of the day targeted. Valid values are integers between 0 and 23 with 0 representing 12 a.m. and 23 representing 11 p.m.

If an day-of-the-week array is an empty array or contains all possible values (0-23), the entire day is targeted.

Field Description Data Type
sunday An array of integers that specify the hours of the day targeted. Valid values: [0-23]. array
monday An array of integers that specify the hours of the day targeted. Valid values: [0-23]. array
tuesday An array of integers that specify the hours of the day targeted. Valid values: [0-23]. array
wednesday An array of integers that specify the hours of the day targeted. Valid values: [0-23]. array
thursday An array of integers that specify the hours of the day targeted. Valid values: [0-23]. array
friday An array of integers that specify the hours of the day targeted. Valid values: [0-23]. array
saturday An array of integers that specify the hours of the day targeted. Valid values: [0-23]. array

Note

For a complete list of targeting resource fields, see Targeting Object.

Read Day Parting Targets

Returns a list of target types (audiences, exchanges, etc.) targeted by the specified line including dayParting targets.

GET /traffic/lines/{id}/targeting

The resource returns information about all of the target types enabled and all of the targets specified for the line including DAY_PARTING targets.

To learn more, see Read Line Targeting.

Parameters

The API takes the following parameters:

Table 140 Read Day Parting Parameters
Parameter Parameter Type Description Data Type Required
id path Specifies the line ID. integer Y

Example Request

GET /traffic/lines/365277/targeting

Example Response

{
  "response":
    {
      "types": [ {
        "id":8,
        "name": "DAY_PARTING",
        "isTargeted": true
        }],
      "dayParting":{
        "monday":[3],
        "tuesday":[ 4, 5, 7]
        }
    },
  "errors": null,
  "timestamp": "2018-02-22T00:24:22Z"
  }

Add/Update Day Parting Targets

Adds or updates dayParting targets for the specified line.

POST traffic/lines/{id}/targeting/

The dayParting object defines the days of the week and hours of the day that are targeted by a specific line. To learn more, see Day Parting Object.

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.

Table 141 Add Day Parting Target Parameters
Parameter Parameter Type Description Data Type Required?
id path Specifies the line ID. integer Y
dayParting body

Specifies a dayParting object that specifies the days and hours targeted.

The dayParting object consists of multiple arrays representing days of the week. Each day is defind by an array of integers that specify the hours of the day targeted. An empty array targets the entire day. To learn more, see Day Parting Object.

object Y
types body

Specifies an array of Targeting Type objects.

To target day parting, the DAY_PARTING targeting type must be enabled. To learn more, see Targeting Types.

array Y

Example Request

The line ID is specified in the path of the resource endpoint:

POST traffic/lines/365277/targeting/

All other parameters are specified in the body of the application/json payload.

{
  "dayParting": {
    "sunday": [ ],
    "monday": [ 3 ],
    "tuesday": [4, 5, 7]
  },
  "types": [
    {
      "name": "DAY_PARTING",
      "isTargeted": true
    }
  ]
}

The line ID is specified in the path of the endpoint URL:

POST traffic/lines/365277/targeting/

All other parameters are specified in the body of the application/json payload.

{
   "dayParting":{
      "sunday":[   ],
      "monday":[ 3 ],
      "tuesday":[  4, 5, 7 ]
   },
   "types":[
      {
         "name":"DAY_PARTING",
         "isTargeted":true
      }
   ]
}

See also

About Targeting