update
Changes the parameters of ad groups.
Restrictions
To manage unified performance groups, use the URL: https://api.direct.yandex.com/v501/
.
Maximum of 1000 groups per method call.
You can't change groups in archived campaigns.
Request
Request structure in JSON format:
{
"method": "update",
"params": { /* params */
"AdGroups": [{ /* AdGroupUpdateItem */
"Id": (long), /* required */
"Name": (string),
"RegionIds": [(long), ... ],
"NegativeKeywords": { /* ArrayOfString */
"Items": [(string), ... ] /* required */
}, /* nillable */
"NegativeKeywordSharedSetIds": { /* ArrayOfLong */
"Items": [(long), ... ] /* required */
}, /* nillable */
"TrackingParams": (string),
"MobileAppAdGroup": { /* MobileAppAdGroupUpdate */
"TargetDeviceType": [( "DEVICE_TYPE_MOBILE" | "DEVICE_TYPE_TABLET" ), ... ],
"TargetCarrier": ( "WI_FI_ONLY" | "WI_FI_AND_CELLULAR" ),
"TargetOperatingSystemVersion": (string)
},
"DynamicTextAdGroup": [{ /* DynamicTextAdGroupUpdate */
"DomainUrl": (string) /* required */,
"AutotargetingCategories" : [{ /* AutotargetingCategoriesUpdate */
"Category" : ( "EXACT" | "ALTERNATIVE" | "COMPETITOR" | "BROADER" | "ACCESSORY" ) /* required */,
"Value" : ( "YES" | "NO" ) /* required */
}, ...]
}, ...],
"DynamicTextFeedAdGroup": { /* DynamicTextFeedAdGroupUpdate*/
"AutotargetingCategories" : [{ /* AutotargetingCategoriesUpdate */
"Category" : ( "EXACT" | "ALTERNATIVE" | "COMPETITOR" | "BROADER" | "ACCESSORY" ) /* required */,
"Value" : ( "YES" | "NO" ) /* required */
}, ...]
},
"SmartAdGroup": { /* SmartAdGroupUpdate */
"AdTitleSource": (string), /* nillable */
"AdBodySource": (string) /* nillable */
},
"TextAdGroupFeedParams" : { /* TextAdGroupFeedParamsUpdate */
"FeedId" : (long) /* required nillable */,
"FeedCategoryIds" : { /* nillable */
"Items" : [ (long) ] /* required */
}
},
"UnifiedAdGroup" : {
"OfferRetargeting" : ("YES"|"NO")
}
}, ... ] /* required */
}
}
Parameter | Type | Description | Required |
Params structure (for JSON) / UpdateRequest structure (for SOAP) | |||
---|---|---|---|
AdGroups | array of AdGroupUpdateItem | The groups to change the parameters for. | Yes |
AdGroupUpdateItem structure | |||
Id | long | The ID of the group to update parameters for. | Yes |
Name | string | The name of the ad group (from 1 to 255 characters). | No |
RegionIds | array of long | Array of IDs of regions where ad impressions are enabled or disabled. The array must contain at least one item. The ID "0" indicates to display ads in all regions. A minus sign before a region ID disables impressions in this region. For example, [1,-219] indicates to display for Moscow and the entire Moscow area, except Chernogolovka. Minus regions can't be used if 0 is set. The array must not consist of only minus regions. To get the list of regions, use the Dictionaries.get method. | No |
NegativeKeywords | ArrayOfString, nillable | Array of negative keywords that are shared by all the keywords of an ad group. Restriction. Negative keywords are not allowed in a group of display ads with targeting criteria based on a user profile. A keyword should be specified without the minus sign before the first word. Maximum of 7 words per keyword. The maximum length of each word is 35 characters. The maximum combined length of negative keywords in the array is 4096 characters. Spaces, dashes, and operators are not counted as part of the total length. Note. Negative keywords that are shared for all a campaign's ad groups should preferably be set in the campaign parameter of the same name. | No |
NegativeKeywordSharedSetIds | ArrayOfLong, nillable | IDs of sets of negative keywords. Maximum of 3 items in the array. To get set IDs, use the NegativeKeywordSharedSets.get method. Restriction. Negative keywords are not allowed in a group of display ads with targeting criteria based on a user profile. | No |
TrackingParams | string | GET parameters for tracking traffic sources that are added to the link of all ads in the group (maximum of 1024 characters). May contain substitution variables. For example: from=direct&ad={ad_id} Image ads, dynamic ads, and smart banners. However, currently it's only used for groups of dynamic ads and smart banners. | No |
MobileAppAdGroup | MobileAppAdGroupUpdate | Parameters of ad groups for mobile app ads. | No |
DynamicTextAdGroup | DynamicTextAdGroupUpdate | Parameters of a group of dynamic ads. | No |
DynamicTextFeedAdGroup | DynamicTextFeedAdGroupUpdate | Parameters of a group of dynamic ads with the FEED subtype. | No |
SmartAdGroup | SmartAdGroupUpdate | Parameters for ad group of smart banners. | No |
TextAdGroupFeedParams | TextAdGroupFeedParamsUpdate | Parameters of a Text & Image ads group. | No |
UnifiedAdGroup | UnifiedAdGroupUpdate | Parameters of a unified performance group. See Ad group type. | No |
MobileAppAdGroupUpdate structure | |||
TargetDeviceType | array of DeviceTypeEnum | Which devices to show ads on:
| No |
TargetCarrier | CarrierEnum | Which types of internet connections to show ads on:
| No |
TargetOperatingSystemVersion | string | The minimum OS version to display the ad on. For example, 2.3. Note. If the minimum OS version in the app store is higher than the one set in this parameter, ads are displayed only for OS versions equal to or higher than the one in the app store. | No |
DynamicTextAdGroup structure | |||
DomainUrl | string | The domain name of the site to generate dynamic ads for (a maximum of 100 characters). The protocol can be omitted. | Yes |
AutotargetingCategories | array of AutotargetingCategoriesUpdateItem | Targeting categories to be added. | No |
DynamicTextFeedAdGroupUpdate structure | |||
AutotargetingCategories | array of AutotargetingCategoriesUpdateItem | Targeting categories to be added. | No |
AutotargetingCategoriesUpdateItem structure | |||
Category | AutotargetingCategoriesEnum | Targeting category:
| Yes |
Value | YesNoEnum | The flag indicating that the specified targeting category is enabled. All targeting categories are enabled by default. | Yes |
SmartAdGroupUpdate structure | |||
AdTitleSource | string, nillable | The name of the feed element to use for the ad title. If omitted, the title is generated automatically. | No |
AdBodySource | string, nillable | The name of the feed element to use for the ad text. If omitted, the text is generated automatically. | No |
TextAdGroupFeedParamsUpdate structure | |||
FeedId | long, nillable | ID of the feed on the basis of which Text & Image ads must be generated. | No |
FeedCategoryIds | ArrayOfLong | Image ads must be generated. If no category IDs are specified, all categories from the feed are used. | No |
UnifiedAdGroupUpdate structure | |||
OfferRetargeting | YesNoEnum | Indicates that offer retargeting is enabled. | No |
Parameter | Type | Description | Required |
Params structure (for JSON) / UpdateRequest structure (for SOAP) | |||
---|---|---|---|
AdGroups | array of AdGroupUpdateItem | The groups to change the parameters for. | Yes |
AdGroupUpdateItem structure | |||
Id | long | The ID of the group to update parameters for. | Yes |
Name | string | The name of the ad group (from 1 to 255 characters). | No |
RegionIds | array of long | Array of IDs of regions where ad impressions are enabled or disabled. The array must contain at least one item. The ID "0" indicates to display ads in all regions. A minus sign before a region ID disables impressions in this region. For example, [1,-219] indicates to display for Moscow and the entire Moscow area, except Chernogolovka. Minus regions can't be used if 0 is set. The array must not consist of only minus regions. To get the list of regions, use the Dictionaries.get method. | No |
NegativeKeywords | ArrayOfString, nillable | Array of negative keywords that are shared by all the keywords of an ad group. Restriction. Negative keywords are not allowed in a group of display ads with targeting criteria based on a user profile. A keyword should be specified without the minus sign before the first word. Maximum of 7 words per keyword. The maximum length of each word is 35 characters. The maximum combined length of negative keywords in the array is 4096 characters. Spaces, dashes, and operators are not counted as part of the total length. Note. Negative keywords that are shared for all a campaign's ad groups should preferably be set in the campaign parameter of the same name. | No |
NegativeKeywordSharedSetIds | ArrayOfLong, nillable | IDs of sets of negative keywords. Maximum of 3 items in the array. To get set IDs, use the NegativeKeywordSharedSets.get method. Restriction. Negative keywords are not allowed in a group of display ads with targeting criteria based on a user profile. | No |
TrackingParams | string | GET parameters for tracking traffic sources that are added to the link of all ads in the group (maximum of 1024 characters). May contain substitution variables. For example: from=direct&ad={ad_id} Image ads, dynamic ads, and smart banners. However, currently it's only used for groups of dynamic ads and smart banners. | No |
MobileAppAdGroup | MobileAppAdGroupUpdate | Parameters of ad groups for mobile app ads. | No |
DynamicTextAdGroup | DynamicTextAdGroupUpdate | Parameters of a group of dynamic ads. | No |
DynamicTextFeedAdGroup | DynamicTextFeedAdGroupUpdate | Parameters of a group of dynamic ads with the FEED subtype. | No |
SmartAdGroup | SmartAdGroupUpdate | Parameters for ad group of smart banners. | No |
TextAdGroupFeedParams | TextAdGroupFeedParamsUpdate | Parameters of a Text & Image ads group. | No |
UnifiedAdGroup | UnifiedAdGroupUpdate | Parameters of a unified performance group. See Ad group type. | No |
MobileAppAdGroupUpdate structure | |||
TargetDeviceType | array of DeviceTypeEnum | Which devices to show ads on:
| No |
TargetCarrier | CarrierEnum | Which types of internet connections to show ads on:
| No |
TargetOperatingSystemVersion | string | The minimum OS version to display the ad on. For example, 2.3. Note. If the minimum OS version in the app store is higher than the one set in this parameter, ads are displayed only for OS versions equal to or higher than the one in the app store. | No |
DynamicTextAdGroup structure | |||
DomainUrl | string | The domain name of the site to generate dynamic ads for (a maximum of 100 characters). The protocol can be omitted. | Yes |
AutotargetingCategories | array of AutotargetingCategoriesUpdateItem | Targeting categories to be added. | No |
DynamicTextFeedAdGroupUpdate structure | |||
AutotargetingCategories | array of AutotargetingCategoriesUpdateItem | Targeting categories to be added. | No |
AutotargetingCategoriesUpdateItem structure | |||
Category | AutotargetingCategoriesEnum | Targeting category:
| Yes |
Value | YesNoEnum | The flag indicating that the specified targeting category is enabled. All targeting categories are enabled by default. | Yes |
SmartAdGroupUpdate structure | |||
AdTitleSource | string, nillable | The name of the feed element to use for the ad title. If omitted, the title is generated automatically. | No |
AdBodySource | string, nillable | The name of the feed element to use for the ad text. If omitted, the text is generated automatically. | No |
TextAdGroupFeedParamsUpdate structure | |||
FeedId | long, nillable | ID of the feed on the basis of which Text & Image ads must be generated. | No |
FeedCategoryIds | ArrayOfLong | Image ads must be generated. If no category IDs are specified, all categories from the feed are used. | No |
UnifiedAdGroupUpdate structure | |||
OfferRetargeting | YesNoEnum | Indicates that offer retargeting is enabled. | No |
Response
Response structure in JSON format:
{
"result": { /* result */
"UpdateResults": [{ /* 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) / UpdateResponse structure (for SOAP) | ||
---|---|---|
UpdateResults | array of ActionResult | Results of updating group parameters. |
ActionResult structure | ||
Id | long | Group ID. Returned if there are no errors, see Operations on object arrays. |
Warnings | array of ExceptionNotification | Warnings that occurred during the operation. |
Errors | array of ExceptionNotification | Errors that occurred during the operation. |
Parameter | Type | Description |
Result structure (for JSON) / UpdateResponse structure (for SOAP) | ||
---|---|---|
UpdateResults | array of ActionResult | Results of updating group parameters. |
ActionResult structure | ||
Id | long | Group ID. Returned if there are no errors, see Operations on object arrays. |
Warnings | array of ExceptionNotification | Warnings that occurred during the operation. |
Errors | array of ExceptionNotification | Errors that occurred during the operation. |