add
Creates keywords and autotargetings.
Alert
The method doesn't save duplicates of keywords. See Duplicate keywords.
You can set a bid based on your campaign's strategy:
-
If your campaign uses a manual strategy, you can specify the
Bid
parameter. If the strategy allows you to manage bids for ad networks separately, you can specifyBid
andContextBid
.If an item in the input array contains parameters that are not appropriate for the strategy, the values of these parameters are saved and a warning is issued.
-
If you've set up an automatic strategy for your campaign but specified the
Bid
and/orContextBid
parameter when creating keywords, these bid values won't be applied. When the strategy changes from automatic to manual, the bid will be selected by an automatic algorithm. -
If you've set up a manual strategy for your campaign that allows you to manage bids in ad networks separately, but you've specified the
ContextBid
parameter when creating keywords, this bid value will be applied later when the strategy changes to a manual strategy that allows you to manage bids separately.
If the strategy allows for setting bids but the bid is not specified, the default setting is:
-
For a keyword – The minimum bid.
-
For autotargeting for
ContextBid
: A bid calculated from bids for keywords in the ad group (if the group has no keywords, the minimum bid is used). -
For autotargeting for
Bid
: An automatic bid. If automatic bid is disabled: A bid calculated based on bids for keywords in the ad group (a manual bid is always calculated, but it's only used when automatic bid is disabled). If there are no keywords in the ad group, the minimum bid is used.
All targeting categories are enabled by default.
Categories for which neither "YES" nor "NO" is explicitly specified are considered enabled.
Learn more
Restrictions
Maximum of 1000 objects per method call.
Maximum of 1 autotargeting per ad group.
You cannot add keywords to an ad group that has the CPM_BANNER_AD_GROUP type and USER_PROFILE subtype, or to a DYNAMIC_TEXT_AD_GROUP type of ad group.
You cannot add autotargetings to an ad group with the DYNAMIC_TEXT_AD_GROUP or CPM_BANNER_AD_GROUP type.
To check the limit on the number of keywords per ad group for an advertiser, use the Clients.get or AgencyClients.get method (look for the KEYWORDS_TOTAL_PER_ADGROUP element in the Restrictions array).
For restrictions on the number of words and characters in a keyword, see the Quantitative restrictions section in Yandex Direct Help.
Request
Request structure in JSON format:
{
"method": "add",
"params": { /* params */
"Keywords": [{ /* KeywordAddItem */
"Keyword": (string), /* required */
"AdGroupId": (long), /* required */
"Bid": (long),
"AutotargetingSearchBidIsAuto" : ("YES" | "NO"),
"ContextBid": (long),
"StrategyPriority": ( "LOW" | "NORMAL" | "HIGH" ),
"UserParam1": (string),
"UserParam2": (string),
"AutotargetingCategories" : [{ /* AutotargetingCategoriesAddItem */
"Category" : ("EXACT"|"ALTERNATIVE"|"COMPETITOR"|"BROADER"|"ACCESSORY") /* required */,
"Value" : ("YES"|"NO") /* required */
}, ...],
"AutotargetingSettings" : {
"Categories" : {
"Exact" : ("YES"|"NO"),
"Narrow" : ("YES"|"NO"),
"Alternative" : ("YES"|"NO"),
"Accessory" : ("YES"|"NO"),
"Broader" : ("YES"|"NO")
},
"BrandOptions" : {
"WithoutBrands" : ("YES"|"NO"),
"WithAdvertiserBrand" : ("YES"|"NO"),
"WithCompetitorsBrand" : ("YES"|"NO")
}
}
}, ... ] /* required */
}
}
Parameter |
Type |
Description |
Required |
||||||||||
params structure (for JSON) / AddRequest structure (for SOAP) |
|||||||||||||
|
array of KeywordAddItem |
Keywords and autotargetings to add. |
Yes |
||||||||||
KeywordAddItem structure |
|||||||||||||
|
long |
ID of the group to add the keyword or autotargeting to. |
Yes |
||||||||||
|
string |
Keywords. It can contain negative keywords, which are specified with the minus sign before the word, such as lightning -thunder -rain. The maximum length of a keyword is 4096 characters. The "!" operator before a negative keyword doesn't count toward the keyword length (the sequence "-!" is considered a single character). Maximum of 7 words per keyword, not counting stop words and negative keywords. Each word can have up to 35 characters, not counting the minus sign before a negative keyword. Note If you have negative keywords that apply to all of an ad group's keywords, set them in the [NegativeKeywords](*NegativeKeywords) parameter for the ad group. If the value is set to |
Yes |
||||||||||
|
long |
The bid on search, multiplied by 1,000,000. Integer. Only for manual strategies. 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 |
||||||||||
|
YesNoEnum |
A flag indicating whether automatic bid is enabled. You can specify a manual bid ( If you've set a manual bid ( If you haven't set a manual bid ( |
No |
||||||||||
|
long |
The bid in ad networks, multiplied by 1,000,000. Integer. Only for manual strategies with independent bid management in the Yandex Advertising Network. Specified in the advertiser's currency. Restrictions are listed in the currency reference. To get it, use the Dictionaries.get method and specify the Alert An image ad can be displayed only if the bid is at least as high as the minimum bid for an ad with an image. |
No |
||||||||||
|
PriorityEnum |
Priority of the keyword or autotargeting: LOW, NORMAL or HIGH. Only for automatic strategies. Alert This parameter is not used, and the passed value is ignored. |
No |
||||||||||
|
string |
Value of the |
No |
||||||||||
|
string |
Value of the |
No |
||||||||||
|
array of AutotargetingCategoriesAddItem |
Targeting categories to be added. Alert This structure is deprecated and will soon cease to be supported. You can't pass both |
No |
||||||||||
|
Targeting settings to add. |
No |
|||||||||||
AutotargetingCategoriesAddItem structure |
|||||||||||||
|
AutotargetingCategoriesEnum |
Targeting category:
Alert This field is deprecated and will soon cease to be supported. The settings specified using the API are converted for the web interface as follows:
|
Yes |
||||||||||
|
YesNoEnum |
The flag indicating that the specified targeting category is enabled. All targeting categories are enabled by default. |
Yes |
||||||||||
AutotargetingSettingsAddItem structure |
|||||||||||||
|
AutotargetingSettingsCategoriesFieldNames |
Targeting categories. Available options:
|
No |
||||||||||
|
AutotargetingSettingsBrandOptionsFieldNames |
Brand mention settings. Available options:
|
No |
Response
Response structure in JSON format:
{
"result": { /* result */
"AddResults": [{ /* ActionResult */
"Id": (long),
"Warnings": [{ /* ExceptionNotification */
"Code": (int), /* required */
"Message": (string), /* required */
"Details": (string)
}, ... ],
"Errors": [{ /* ExceptionNotification */
"Code": (int), /* required */
"Message": (string), /* required */
"Details": (string)
}, ... ]
}, ... ] /* required */
}
}
Parameter |
Type |
Description |
result structure (for JSON) / AddResponse structure (for SOAP) |
||
|
array of ActionResult |
Results of adding keywords or autotargetings. |
ActionResult structure |
||
|
long |
ID of the created keyword or autotargeting. Returned if there aren't any errors. See the section Operations on object arrays. |
|
array of ExceptionNotification |
Warnings that occurred during the operation. |
|
array of ExceptionNotification |
Errors that occurred during the operation. |