setAuto
The automatic bid constructor calculates bids for keywords based on the selected algorithm.
The method sets bids in asynchronous mode and does not return bids. Use the get method to get bids.
A bid can be set only if a manual strategy is selected in the campaign.
The method doesn't reset the automatic bid value (AutotargetingSearchBidIsAuto
).
If an item in the input array contains bids that are not appropriate for the strategy, these bids are not applied.
- If the campaign has an automatic strategy selected, an error is returned.
- If impressions in search results are disabled for the campaign and the
Scope
parameter contains only the SEARCH value, an error is returned. If both values are passed (SEARCH and NETWORK), bids are only updated in ad networks and a warning is displayed. - If your campaign uses a manual strategy in search results, you'll receive an error if the bids aren't managed separately in ad networks, or if impressions in ad networks are disabled, but the
Scope
parameter only specifies NETWORK. If both values are passed (SEARCH and NETWORK), bids are only updated in search results and a warning is displayed.
Alert
-
Bids and prices are passed via the Yandex Direct API as integer numbers. The passed value represents the bid or price multiplied by 1,000,000.
-
All bids and prices are shown in the advertiser's currency.
To set bids in search results, pass the value SEARCH in the Scope parameter.
The bid calculation uses the values passed in the Position, IncreasePercent, CalculateBy, and MaxBid parameters.
Position |
CalculateBy |
Bid calculation formula |
FOOTERBLOCK |
VALUE |
Minimum bid for the 4th position in Guaranteed + minimum bid for the 4th position in Guaranteed × but no greater than |
DIFF |
Minimum bid for the 4th position in Guaranteed + (minimum bid for the 1st position – minimum bid for the 4th position in Guaranteed) × but no greater than |
|
FOOTERFIRST |
VALUE |
Minimum bid for the 1st position in Guaranteed + Minimum bid for the 1st position in Guaranteed × but no greater than |
DIFF |
Minimum bid for the 1st position in Guaranteed + (minimum bid for the 3rd position in Premium – minimum bid for the 1st position in Guaranteed) × but no greater than |
|
PREMIUMBLOCK or P14 |
VALUE |
Minimum bid for the 4th position in Premium + Minimum bid for the 4th position in Premium × but no greater than |
DIFF |
Minimum bid for the 4th position in Premium + (minimum bid for the 3rd position in Premium – minimum bid for the 4th position in Premium) × but no greater than |
|
P13 |
VALUE |
Minimum bid for the 3rd position in Premium + Minimum bid for the 3rd position in Premium × but no greater than |
DIFF |
Minimum bid for the 3rd position in Premium + (Minimum bid for the 2nd position in Premium – Minimum bid for the 3rd position in Premium) × but no greater than |
|
P12 |
VALUE |
Minimum bid for the 2nd position in Premium + Minimum bid for the 2nd position in Premium × but no greater than |
DIFF |
Minimum bid for the 2nd position in Premium + (minimum bid for the 1st position in Premium – minimum bid for the 2nd position in Premium) × but no greater than |
|
PREMIUMFIRST or P11 |
VALUE |
Minimum bid for the 1st position in Premium + minimum bid for the 1st position in Premium × but no greater than |
DIFF |
Minimum bid for the 1st position in Premium, but no greater than |
Note
Over time, competitors' activity might increase the minimum bid for a position, and it will be higher than the advertiser's bid. The higher the markup, the more likely it is that the ad will be shown in the selected position, but expenses are also greater.
You can only set the bid in ad networks for strategies that allow separate management of bids in search results and ad networks.
To set bids in ad networks, pass the value NETWORK in the Scope parameter.
Bid calculation uses the values passed in the ContextCoverage, IncreasePercent, and MaxBid parameters.
Bid calculation formula:
Bid predicted to produce the specified impression frequency + bid predicted to produce the specified impression frequency × IncreasePercent
/ 100,
but no greater than MaxBid
.
Note
Bid calculation is based on probability, and does not guarantee the desired audience coverage.
Learn more
Restrictions
A single request can only set bids for the same type of objects — either for campaigns only, or for groups only, or for keywords only. The method doesn't support setting the bid for autotargeting separately.
Maximum number of objects per method call:
- Campaigns — 10.
- Groups — 1000.
- Keywords — 10,000.
Request
Request structure in JSON format:
{
"method": "setAuto",
"params": { /* params */
"Bids": [{ /* BidSetAutoItem */
"CampaignId": (long),
"AdGroupId": (long),
"KeywordId": (long),
"MaxBid": (long),
"Position": ( "PREMIUMFIRST" | "PREMIUMBLOCK" | "FOOTERFIRST" | "FOOTERBLOCK" | "P11" | "P12" | "P13" | "P14" | "P21" | "P22" | "P23" | "P24" ),
"IncreasePercent": (int),
"CalculateBy": ( "VALUE" | "DIFF" ),
"ContextCoverage": (int),
"Scope": [( "SEARCH" | "NETWORK" ), ... ] /* required */
}, ... ] /* required */
}
}
Parameter |
Type |
Description |
Required |
params structure (for JSON) / SetAutoRequest structure (for SOAP) |
|||
|
array of BidSetAutoItem |
Bid calculation parameters |
Yes |
BidSetAutoItem structure |
|||
|
long |
The campaign ID. Specified when updating the bid for all the campaign's keywords. |
Use either |
|
long |
ID of the ad group. Specified when the bid needs to be updated for all the group's keywords. |
|
|
long |
The keyword ID. Specified when updating the bid for an individual keyword. Alert The autotargeting ID is not allowed. |
|
|
array of ScopeEnum |
Specifies which bids to set. The array may contain the following elements (one or both):
|
Yes |
|
long |
The bid limit 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 |
No |
|
PositionEnum |
The display position whose bid is used as the basis for calculating bids in search results. A markup is added to the bid for the selected position (see the |
If the |
|
int |
Markup percent from 0 to 1000. If omitted, markup is not calculated. |
No |
|
CalculateByEnum |
The base for calculating the markup:
|
If the |
|
int |
The frequency of impressions (the audience coverage) in ad networks. Indicated as a percentage from 0 to 100. A markup is added to the bid that is required to get the selected audience coverage (see the |
If the |
Alert
The CampaignId
, AdGroupId
, and KeywordId
parameters are mutually exclusive. A single request may only contain one of these parameters.
Response
Response structure in JSON format:
{
"result": { /* result */
"SetAutoResults": [{ /* BidActionResult */
"Warnings": [{ /* ExceptionNotification */
"Code": (int), /* required */
"Message": (string), /* required */
"Details": (string)
}, ... ],
"Errors": [{ /* ExceptionNotification */
"Code": (int), /* required */
"Message": (string), /* required */
"Details": (string)
}, ... ],
"CampaignId": (long),
"AdGroupId": (long),
"KeywordId": (long)
}, ... ]
}
}
Parameter |
Type |
Description |
result structure (for JSON) / SetAutoResponse structure (for SOAP) |
||
|
array of BidActionResult |
The results of the bidding. |
BidActionResult structure |
||
|
long |
The campaign ID. Returned if there aren't any errors. See the section Operations on object arrays (if it was specified in the request). |
|
long |
ID of the ad group. Returned if there aren't any errors. See the section Operations on object arrays (if it was specified in the request). |
|
long |
Keyword ID. Returned if there aren't any errors. See the section Operations on object arrays (if it was specified in the request). |
|
array of ExceptionNotification |
Warnings that occurred during the operation. |
|
array of ExceptionNotification |
Errors that occurred during the operation. |
Examples
Request example
Set the price in search results of the 1st position in Guaranteed + 50% of the difference from Premium, but no greater than 0.25.
{
"method" : "setAuto",
"params" : {
"Bids" : [
{
"Scope" : [
"SEARCH"
],
"IncreasePercent" : 50,
"CalculateBy" : "DIFF",
"Position" : "FOOTERFIRST",
"KeywordId" : 1574449505,
"MaxBid" : 250000
}
]
}
}
Response example
{
"result" : {
"SetAutoResults" : [
{
"KeywordId" : 1574449505
}
]
}
}