Add
Creates a retargeting condition.
Alert
Disabled method. Use version 5 of the API.
For information about the compatibility of methods between versions Live 4 and 5, see the Migration guide.
Input data
The input data structure in JSON is shown below.
{
"method": "RetargetingCondition",
"param": {
/* RetargetingConditionRequest */
"Action": (string),
"RetargetingConditions": [
{ /* RetargetingCondition */
"RetargetingConditionName": (string),
"RetargetingConditionDescription": (string),
"Login": (string),
"RetargetingCondition": [
{ /* RetargetingConditionItem */
"Type": (string),
"Goals": [
{ /* RetargetingConditionGoalItem */
"Time": (int),
"GoalID": (long)
}
...
]
}
...
]
}
...
]
}
}
Parameters are described below.
Parameter |
Description |
Required |
RetargetingConditionRequest object |
||
|
Action: Add. |
Yes |
|
Array of |
Yes |
RetargetingCondition object |
||
|
Name of the retargeting condition (maximum 250 characters). |
Yes |
|
Text description of the retargeting condition (maximum 4096 characters). |
No |
|
Username of the condition's owner. Direct advertisers set their own Yandex username; advertising agencies set their client's username. |
Yes |
|
Array of |
Yes |
RetargetingConditionItem object |
||
|
Type of group:
A retargeting condition that uses Yandex Metrica segments or Yandex Audience segments must contain at least one "all" or "or" type of group. A retargeting condition that consists solely of "not" groups can only use Yandex Metrica goals. |
Yes |
|
Array of goals and segments ( |
Yes |
RetargetingConditionGoalItem object |
||
|
Number of days (from 1 to 90) for checking whether goals are completed or segments are matched. |
For Yandex Metrica goals and segments |
|
ID of the goal or segment. |
Yes |
Output data
Alert
An error when adding one of the retargeting conditions does not cause the entire operation to be canceled, and does not affect the success of adding other retargeting conditions.
The output data structure in JSON is shown below.
{
"data": {
/* RetargetingConditionResponse */
"ActionsResult": [
{ /* RetargetingConditionActionResult */
"Warnings": [
{ /* Warning */
"WarningCode": (int),
"WarningString": (string),
"Description": (string)
}
...
],
"Errors": [
{ /* Error */
"FaultCode": (int),
"FaultString": (string),
"FaultDetail": (string)
}
...
],
"RetargetingConditionID": (int)
}
...
]
}
}
Parameters are described below.
Parameter |
Description |
RetargetingConditionResponse object |
|
|
Array of
The items in the array are in the same order as the objects in the |
RetargetingConditionActionResult object |
|
|
Array of |
|
Array of |
|
ID of the retargeting condition. |
Warning object |
|
|
Warning code. |
|
Warning text. |
|
Warning description in JSON format. |
Error object |
|
|
Error code. |
|
Textual message about the error. |
|
Detailed description of the reason for the error. |
Examples of input data
Python
{
'Action': 'Add',
'RetargetingConditions': [
{
'RetargetingConditionName': u'Order incomplete',
'RetargetingConditionDescription': u'Added items to basket but didn't complete the order',
'Login': 'agrom',
'RetargetingCondition': [
{
'Type': 'or',
'Goals': [
{
'Time': 14,
'GoalID': 1557799
},
{
'Time': 14,
'GoalID': 1558005
}
]
},
{
'Type': 'not',
'Goals': [
{
'Time': 11,
'GoalID': 1559911
}
]
}
]
}
]
}
PHP
array(
'Action' => 'Add',
'RetargetingConditions' => array(
array(
'RetargetingConditionName' => 'Order incomplete',
'RetargetingConditionDescription' => 'Added items to basket but didn't complete the order',
'Login' => 'agrom',
'RetargetingCondition' = array(
array(
'Type' => 'or',
'Goals' => array(
array(
'Time' => 14,
'GoalID' =1557799
),
array(
'Time' => 14,
'GoalID' =1558005
)
)
),
array(
'Type' => 'not',
'Goals' => array(
array(
'Time' => 11,
'GoalID' =1559911
)
)
)
)
)
)
)
Perl
{
'Action' => 'Add',
'RetargetingConditions' => [
{
'RetargetingConditionName' => 'Order incomplete',
'RetargetingConditionDescription' => 'Added items to basket but didn't complete the order',
'Login' => 'agrom',
'RetargetingCondition' => [
{
'Type' => 'or',
'Goals' => [
{
'Time' => 14,
'GoalID' =1557799
},
{
'Time' => 14,
'GoalID' =1558005
}
]
},
{
'Type' => 'not',
'Goals' => [
{
'Time' => 11,
'GoalID' =1559911
}
]
}
]
}
]
}