targetingUser

Target a banner by user characteristics.

Targeting by user characteristics is a type of targeting where the characteristics for selecting a target audience are determined by an Adfox client. Every characteristic contains a set of values that represent what the site knows about the page or its visitor. The targeting values are sent from the site using the ad tag.

To set up targeting, enable the characteristic and add a list of values.

In the ad tag, add a value or list of values separated by a colon to the puidN parameter (where N is the characteristic number from 1 to 63) to select ad campaigns targeted by these values.

All values are enabled by default. For this reason, you need to disable v0 — which represents the unknown, not set value — to ensure that your targeting works correctly. To do this, specify v0=0 in your request.

Request format

https://adfox.yandex.com/api/v1
  ? object=banner
  & action=target
  & actionObject=targetingUser
  & objectID=<integer>
  & isRedefined=<integer>
  & criteriaID=<integer>
  & vN=<integer>

objectID*

ID of the object that the action is performed on.

isRedefined*

Redefine targeting.

Acceptable values:

  • 0: Inherit targeting settings from a higher level. Level hierarchy from top to bottom:

    • Campaign.
    • Campaign on the site.
    • Campaign in the site section.
    • Campaign on the placement.
    • Banner.
  • 1: Cancel targeting settings from higher levels and use the parameters set at the current level.

criteriaID*

Characteristic ID.

Acceptable values:

  • 1≤N≤63, where N is the characteristic number from 1 to 63 inclusive.

vN*

Where N in the parameter name is the ID of a characteristic value.

Acceptable values:

  • 0: Disable.
  • 1: Enable.

All values are enabled by default. For this reason, you need to disable the unknown, not set value to ensure that your targeting works correctly:

  • v0: the unknown, not set value.
  • v0=0 disables the unknown, not set value.

* Required parameter

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=banner&action=target&actionObject=targetingUser&objectID=474205&criteriaID=1&v0=0&v5345=1&isRedefined=1

Response:

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

Other actions with the object

Read also about other actions with the banner object:

Where N in the parameter name is the ID of a characteristic value.

Acceptable values:

  • 0: Disable.

  • 1: Enable.

Required parameter.

ID of the object that the action is performed on.

Redefine targeting.

Acceptable values:

  • 0: Inherit targeting settings from a higher level. Level hierarchy from top to bottom:

    • Campaign.
    • Campaign on the site.
    • Campaign in the site section.
    • Campaign on the placement.
    • Banner.
  • 1: Cancel targeting settings from higher levels and use the parameters set at the current level.

The ID of a characteristic.

Acceptable values: 1≤N≤63, where N is the characteristic number from 1 to 63 inclusive.