Update

Changes a retargeting condition.

Attention.

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 Action: Update. Yes
RetargetingConditions Array of RetargetingCondition objects containing information about retargeting conditions. Yes
RetargetingCondition object
Fields 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
RetargetingConditionName Name of the retargeting condition (maximum 250 characters). No
RetargetingConditionDescription Text description of the retargeting condition (maximum 4096 characters). No
RetargetingConditionID

ID of the retargeting condition.

Yes
RetargetingCondition Array of RetargetingConditionItem objects. Each object contains a group that describes the desired user behavior. If the retargeting condition has several groups, they are united with the logical AND operator (the condition is satisified if all the groups of goals are achieved). Yes
RetargetingConditionItem object
Type

Type of group:

  • all — The group is satisfied if all the goals and segments are met.
  • or — The group is satisfied if at least one of the goals or segments is met.
  • not — The group is satisfied if none of the goals or segments is met.

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
Goals Array of goals and segments (RetargetingConditionGoalItem objects). Yes
RetargetingConditionGoalItem object
Time

Number of days (from 1 to 90) for checking whether goals are completed or segments are matched.

For Yandex Metrica goals and segments
GoalID ID of the goal or segment. Yes
Parameter Description Required
RetargetingConditionRequest object
Action Action: Update. Yes
RetargetingConditions Array of RetargetingCondition objects containing information about retargeting conditions. Yes
RetargetingCondition object
Fields 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
RetargetingConditionName Name of the retargeting condition (maximum 250 characters). No
RetargetingConditionDescription Text description of the retargeting condition (maximum 4096 characters). No
RetargetingConditionID

ID of the retargeting condition.

Yes
RetargetingCondition Array of RetargetingConditionItem objects. Each object contains a group that describes the desired user behavior. If the retargeting condition has several groups, they are united with the logical AND operator (the condition is satisified if all the groups of goals are achieved). Yes
RetargetingConditionItem object
Type

Type of group:

  • all — The group is satisfied if all the goals and segments are met.
  • or — The group is satisfied if at least one of the goals or segments is met.
  • not — The group is satisfied if none of the goals or segments is met.

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
Goals Array of goals and segments (RetargetingConditionGoalItem objects). Yes
RetargetingConditionGoalItem object
Time

Number of days (from 1 to 90) for checking whether goals are completed or segments are matched.

For Yandex Metrica goals and segments
GoalID ID of the goal or segment. Yes

Output data

Attention. 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
ActionsResult

Array of RetargetingConditionActionResult objects. Each object corresponds to an item in the RetargetingConditions input array.

  • If the operation was completed successfully, the object contains the ID of the added/updated retargeting condition.
  • If the operation was completed but issues occurred during the operation, the object contains the ID of the added/updated retargeting condition and a Warnings array containing a description of those issues.
  • The Errors array, if an error occurred.

The items in the array are in the same order as the objects in the RetargetingConditions input array.

RetargetingConditionActionResult object
Warnings Array of Warning objects describing issues that occurred while performing the operation.
Errors Array of Error objects with errors that occurred while performing the operation.
RetargetingConditionID ID of the retargeting condition.
Warning object
WarningCode Warning code.
WarningString Warning text.
Description Warning description in JSON format.
Error object
FaultCode Error code.
FaultString Textual message about the error.
FaultDetail Detailed description of the reason for the error.
Parameter Description
RetargetingConditionResponse object
ActionsResult

Array of RetargetingConditionActionResult objects. Each object corresponds to an item in the RetargetingConditions input array.

  • If the operation was completed successfully, the object contains the ID of the added/updated retargeting condition.
  • If the operation was completed but issues occurred during the operation, the object contains the ID of the added/updated retargeting condition and a Warnings array containing a description of those issues.
  • The Errors array, if an error occurred.

The items in the array are in the same order as the objects in the RetargetingConditions input array.

RetargetingConditionActionResult object
Warnings Array of Warning objects describing issues that occurred while performing the operation.
Errors Array of Error objects with errors that occurred while performing the operation.
RetargetingConditionID ID of the retargeting condition.
Warning object
WarningCode Warning code.
WarningString Warning text.
Description Warning description in JSON format.
Error object
FaultCode Error code.
FaultString Textual message about the error.
FaultDetail 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
                  }
               ]
            }
         ]
      }
   ]
}