Update
Changes 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.
Restrictions
If a retargeting condition contains at least one "all" or "or" type of group, after editing, it still must contain at least one "all" or "or" group.
If a retargeting condition contains only "not" groups, it still must contain only "not" groups after editing.
Input data
The input data structure in JSON is shown below.
{
"method": "RetargetingCondition",
"param": {
/* RetargetingConditionRequest */
"Action": (string),
"RetargetingConditions": [
{ /* RetargetingCondition */
"Fields": [
(string)
...
],
"RetargetingConditionName": (string),
"RetargetingConditionDescription": (string),
"RetargetingConditionID": (int),
"RetargetingCondition": [
{ /* RetargetingConditionItem */
"Type": (string),
"Goals": [
{ /* RetargetingConditionGoalItem */
"Time": (int),
"GoalID": (long)
}
...
]
}
...
]
}
...
]
}
}
Parameters are described below.
Parameter |
Description |
Required |
RetargetingConditionRequest object |
||
|
Action: Update. |
Yes |
|
Array of |
Yes |
RetargetingCondition object |
||
|
Names of parameters to be updated. If omitted, all parameters will be updated (and if the value is not set, they will be reset). |
No |
|
Name of the retargeting condition (maximum 250 characters). |
No |
|
Text description of the retargeting condition (maximum 4096 characters). |
No |
|
ID of the retargeting condition. |
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 changing one of the retargeting conditions does not cause the entire operation to be canceled, and does not affect the success of changing 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': 'Update',
'RetargetingConditions': [
{
'Fields': ['RetargetingCondition'],
'RetargetingConditionID': 123789,
'RetargetingCondition': [
{
'Type': 'or',
'Goals': [
{
'Time': 14,
'GoalID': 1557799
},
{
'Time': 14,
'GoalID': 1558005
}
]
}
]
}
]
}
PHP
array(
'Action' => 'Update',
'RetargetingConditions' => array(
array(
'Fields' => array('RetargetingCondition'),
'RetargetingConditionID' => 123789,
'RetargetingCondition' => array(
array(
'Type' => 'or',
'Goals' => array(
array(
'Time' => 14,
'GoalID' =1557799
),
array(
'Time' => 14,
'GoalID' =1558005
)
)
)
)
)
)
)
Perl
{
'Action' => 'Update',
'RetargetingConditions' => [
{
'Fields' => ['RetargetingCondition'],
'RetargetingConditionID' => 123789,
'RetargetingCondition' => [
{
'Type' => 'or',
'Goals' => [
{
'Time' => 14,
'GoalID' =1557799
},
{
'Time' => 14,
'GoalID' =1558005
}
]
}
]
}
]
}