targetingBehavior

Target a campaign by behavior.

Request format

https://adfox.yandex.com/api/v1
  ? object=campaign
  & action=target
  & actionObject=targetingBehavior
  & objectID=<integer>
  & behaviorMode=<integer>
  & [UTLogic=<integer>]
  & [UTNotN=<integer>]
  & [categoryIDN=<integer>]
  & [visitsN=<integer>]
  & [timeoutN=<integer>]
  & [UTSVisitsN=<integer>]
  & [UTSTimeoutN=<integer>]

objectID*

ID of the object the action applies to.

behaviorMode*

Use targeting by behavior for users labeled via:

  • 0 — permanent category, if audience labeling is based on categories assigned to sites, sections, and placements.
  • 1 — temporary category, if audience labeling is based on action points.

UTLogic

In targeting by behavior, the advertiser sets the conditions when ad display is allowed.

There are two ways conditions can be applied: any of the given conditions is true and all specified conditions are true. You can set up to 9 conditions. Each condition includes 4 parameters, where N in the parameter name is the condition number from 1 to 9:

  • Labeled/unlabeled users (UTNotN).
  • If the user is labeled, which category (categoryIDN) is used.
  • How many times the user is labeled (visitsN).
  • When the user was last labeled (timeoutN).

Specify the conditional logic for serving ad campaign banners to users.

Acceptable values:

  • 0: Any of the given conditions is true.
  • 1: All specified conditions are true.

UTNotN

Select the target audience: labeled or unlabeled users, where N in the parameter name is the condition number from 1 to 9.

Acceptable values:

  • 0: Condition not set.
  • 1: Labeled users.
  • 2: Unlabeled users.

Default value: 0.

categoryIDN

Specify which category the user must be labeled with, where N in the parameter name is the condition number from 1 to 9.

Allowed values: Category ID.

Default value: 0 — not set if targeting is for unlabeled users.

Read also:

visitsN

Specify how many times the user must be labeled, where N in the parameter name is the condition number from 1 to 9.

Acceptable values: Integers from 1 to 2147483647.

timeoutN

Specify how many days ago the user must have been labeled last, where N in the parameter name is the condition number from 1 to 9.

Acceptable values: Integers from 1 to 2147483647.

UTSVisitsN

Visits at least a specified number of times, where N is the condition number.

Acceptable values: Integers from 1 to 2147483647.

UTSTimeoutN

The last visit was no later than the number of days specified, where N is the condition number.

Acceptable values: Integers from 1 to 2147483647.

Response format

<response>
  <status>
    <code>{integer}</code>
  </status>
</response>

Response parameters

code

Request processing status. A value of 0 means the request was completed successfully. For the key, see Error handling.

Sample request and response

Request:

https://adfox.yandex.com/api/v1?object=campaign&action=target&actionObject=targetingBehavior&objectID=474205&behaviorMode=1

Response:

<response>
  <status>
    <code>0</code>
  </status>
</response>

Other actions with the object

Read more about other actions with the campaign object:

ID of the object the action applies to.

Use targeting by behavior for users labeled via:

  • 0 — permanent category, if audience labeling is based on categories assigned to sites, sections, and placements.
  • 1 — temporary category, if audience labeling is based on action points.

In targeting by behavior, the advertiser sets the conditions when ad display is allowed.

There are two ways conditions can be applied: any of the given conditions is true and all specified conditions are true. You can set up to 9 conditions. Each condition includes 4 parameters, where N in the parameter name is the condition number from 1 to 9:

  • Labeled/unlabeled users (UTNotN).
  • If the user is labeled, which category (categoryIDN) is used.
  • How many times the user is labeled (visitsN).
  • When the user was last labeled (timeoutN).

Specify the conditional logic for serving ad campaign banners to users.

Acceptable values:

  • 0: Any of the given conditions is true.
  • 1: All specified conditions are true.

Select the target audience: labeled or unlabeled users, where N in the parameter name is the condition number from 1 to 9.

Acceptable values:

  • 0: Condition not set.
  • 1: Labeled users.
  • 2: Unlabeled users.

Default value: 0.

Specify which category the user must be labeled with, where N in the parameter name is the condition number from 1 to 9.

Allowed values: Category ID.

Default value: 0 — not set if targeting is for unlabeled users.

Read also:

Specify how many times the user must be labeled, where N in the parameter name is the condition number from 1 to 9.

Acceptable values: Integers from 1 to 2147483647.

Specify how many days ago the user must have been labeled last, where N in the parameter name is the condition number from 1 to 9.

Acceptable values: Integers from 1 to 2147483647.

Visits at least a specified number of times, where N is the condition number.

Acceptable values: Integers from 1 to 2147483647.

The last visit was no later than the number of days specified, where N is the condition number.

Acceptable values: Integers from 1 to 2147483647.

v

Required parameter.