Add

Adds retargetings for an ad group.

Attention.

This method is outdated and will soon be disabled. 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": "Retargeting",
   "param": {
      /* RetargetingRequest */
      "Action": (string),
      "Login": (string),
      "Retargetings": [
         {  /* Retargeting */
            "AdID": (long),
            "RetargetingConditionID": (int),
            "ContextPrice": (float),
            "Currency": (string),
            "AutoBudgetPriority": (string),
            "StatusPaused": (string)
         }
         ...
      ]
   }
}

Parameters are described below.

Parameter Description Required
RetargetingRequest object
Action Action: Add. Yes
Login

The username of the client to add the retargeting for.

For advertisers, this parameter is ignored.

For agencies
Retargetings Array of Retargeting objects containing retargeting parameters for ads. Yes
Retargeting object
AdID

The ad ID.

Yes
RetargetingConditionID

ID of the retargeting condition. The retargeting condition must contain at least one "all" or "or" type of group.

Yes
ContextPrice

Bid for the Yandex Advertising Network when using the MaximumCoverage and Default strategies (in the currency specified in the Currency parameter).

The maximum and minimum values are provided in the ../concepts/multicurrency_const.html#multicurrency_const__limits table.

If an automatic display strategy is selected for the campaign, the value that is passed is ignored, and the 209 warning is returned.

When using manual strategies
Currency

The currency the bid is shown in.

Acceptable values: RUB, CHF, EUR, KZT, TRY, UAH, USD, BYN. The value must match the campaign currency; otherwise, an error is returned with code 245.

Yes
AutoBudgetPriority

Priority of the retargeting when using automatic strategies. Possible values:

  • Low — Low priority.
  • Medium — Average priority.
  • High — High priority.

High priority provides 10-15% more impressions than for keywords/retargetings with medium priority. Low priority reduces impressions by the same amount. If there is only one retargeting for the ad or there are no keywords, this parameter does not affect the number of impressions.

The default value is Medium.

If a manual display strategy is selected for a campaign, the value that is passed is saved, but does not affect impressions.

No
StatusPaused Retargeting is temporarily disabled (not used for displaying ads) — Yes/No. The predefined value is No. No

Output data

Attention. An error when adding one of the retargetings does not cause the entire operation to be canceled, and does not affect the success of adding the other retargetings.

The output data structure in JSON is shown below.

{
   "data": {
      /* RetargetingResponse */
      "ActionsResult": [
         {  /* RetargetingActionResult */
            "Warnings": [
               {  /* Warning */
                  "WarningCode": (int),
                  "WarningString": (string),
                  "Description": (string)
               }
               ...
            ],
            "Errors": [
               {  /* Error */
                  "FaultCode": (int),
                  "FaultString": (string),
                  "FaultDetail": (string)
               }
               ...
            ],
            "RetargetingID": (int)
         }
         ...
      ]
   }
}

Parameters are described below.

Parameter Description
RetargetingResponse object
ActionsResult
Array of RetargetingActionResult objects. Each object corresponds to an item in the Retargetings input array.
  • If the operation was completed successfully, the object contains the retargeting ID.
  • If the operation was completed but issues occurred during the operation, the object contains the retargeting ID 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 Retargetings.
RetargetingActionResult 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.
RetargetingID ID of the retargeting.
Warning object
WarningCode Warning code: 208, 209 or 210.
WarningString Warning text.
Description

Warning description in JSON format. Can be used in combination with WarningCode to automatically identify the problem.

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': 'Add',
   'Login': 'agrom', 
   'Retargetings': [
      {
         'AdID': 2571700,
         'RetargetingConditionID': 4533,
         'ContextPrice': 1.7
      }
   ]
}

PHP

array(
   'Action' => 'Add',
   'Login' => 'agrom',
   'Retargetings' => array(
      array(
         'AdID' => 2571700,
         'RetargetingConditionID' => 4533,
         'ContextPrice' => 1.7
      )
   )
)

Perl

{
   'Action' => 'Add',
   'Login' => 'agrom',
   'Retargetings' => [
      {
         'AdID' => 2571700,
         'RetargetingConditionID' => 4533,
         'ContextPrice' => 1.7
      }
   ]
}