setBids

Assigns CPC, CPA, and priorities for filters.

  1. Restrictions
  2. Request
  3. Response

You can assign CPC, CPA, or priority to an individual filter, to all filters in an ad group, or to all filters in a campaign.

CPC, CPA, or priority is used depending on which display strategy is selected in the campaign:

  • If the campaign uses the AVERAGE_ROI strategy, the StrategyPriority parameter is used: filters with higher priority get more traffic in search results or audience share in ad networks if possible. If the budget runs low, they are the last ones to be disabled.
  • If the campaign uses the AVERAGE_CPA_PER_CAMP or AVERAGE_CPA_PER_FILTER strategy, the AverageCpc or AverageCpa parameters are used.
  • If the campaign uses the AVERAGE_CPC_PER_CAMP or AVERAGE_CPC_PER_FILTER strategy, the AverageCpc parameter is used.

If a bid is specified that doesn't match the strategy, it is ignored. If a priority is specified that doesn't match the strategy, the value is saved but is not used.

Attention.
  • Bids and prices are passed via the Yandex.Direct API as integer numbers. The value that is passed represents the bid or price multiplied by 1,000,000.

  • All bids and prices are shown in the advertiser's currency.

Restrictions

A single request can only set bids for the same type of objects — either for campaigns only, or for groups only, or for filters only.

Maximum number of objects per method call:

  • campaigns — maximum of 10
  • groups — maximum of 1000
  • smart ad targets — maximum of 10,000

Request

Request structure in JSON format:

{
  "method": "setBids",
  "params": { /* params */
    "Bids": [{  /* SetBidsItem */
      "CampaignId": (long),
      "AdGroupId": (long),
      "Id": (long),
      "AverageCpc": (long), /* nillable */
      "AverageCpa": (long), /* nillable */
      "StrategyPriority": ( "LOW" | "NORMAL" | "HIGH" )
    }, ... ] /* required */
  }
}
Parameter Type Description Required
Params structure (for JSON) / SetRequest structure (for SOAP)
Bids array of SetBidsItem Bids and/or priorities. Yes
SetBidsItem structure
CampaignId long The campaign ID. Specified in order to assign a single CPC or CPA for all filters in the campaign. Either CampaignId, AdGroupId, or Id
AdGroupId long ID of the ad group. Specified in order to assign a single CPC, CPA, or priority to all filters in the group.
Id long The ID of the filter. Specified in order to assign a CPC, CPA, or priority to an individual filter.
AverageCpc long, nillable Average CPC multiplied by 1,000,000. Integer.

Specified in the advertiser's currency. Restrictions are listed in the currency reference. To get it, use the Dictionaries.get method and specify the Currencies dictionary name in the request.

At least one of the parameters AverageCpc, AverageCpa or StrategyPriority (or all may be present)
AverageCpa long, nillable Average CPC multiplied by 1,000,000. Integer.

Specified in the advertiser's currency. Restrictions are listed in the currency reference. To get it, use the Dictionaries.get method and specify the Currencies dictionary name in the request.

StrategyPriority PriorityEnum Priority: LOW, NORMAL or HIGH. Used only for the AVERAGE_ROI strategy. No
Attention. The CampaignId, AdGroupId and Id parameters are mutually exclusive. A single request can only contain one of these parameters.

Response

Response structure in JSON format:

{
  "result": {  /* result */
    "SetBidsResults": [{  /* SetBidsActionResult */
      "CampaignId": (long),
      "AdGroupId": (long),
      "Id": (long),
      "Warnings": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ]
    }, ... ]
  }
}
Parameter Type Description
Result structure (for JSON) / SetResponse structure (for SOAP)
SetBidsResults array of SetBidActionResult Results of setting CPC, CPA, or priorities.
SetBidActionResult structure
CampaignId long The campaign ID. Returned if there aren't any errors (if it was specified in the request).
AdGroupId long ID of the ad group. Returned if there aren't any errors (if it was specified in the request).
Id long The ID of the filter. Returned if there aren't any errors (if it was specified in the request).
Warnings array of ExceptionNotification

Warnings that occurred during the operation.

Errors array of ExceptionNotification

Errors that occurred during the operation.