keyword_plan_idea_service.proto 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.ads.googleads.v12.services;
  16. import "google/ads/googleads/v12/common/keyword_plan_common.proto";
  17. import "google/ads/googleads/v12/enums/keyword_match_type.proto";
  18. import "google/ads/googleads/v12/enums/keyword_plan_keyword_annotation.proto";
  19. import "google/ads/googleads/v12/enums/keyword_plan_network.proto";
  20. import "google/api/annotations.proto";
  21. import "google/api/client.proto";
  22. import "google/api/field_behavior.proto";
  23. option csharp_namespace = "Google.Ads.GoogleAds.V12.Services";
  24. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v12/services;services";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "KeywordPlanIdeaServiceProto";
  27. option java_package = "com.google.ads.googleads.v12.services";
  28. option objc_class_prefix = "GAA";
  29. option php_namespace = "Google\\Ads\\GoogleAds\\V12\\Services";
  30. option ruby_package = "Google::Ads::GoogleAds::V12::Services";
  31. // Proto file describing the keyword plan idea service.
  32. // Service to generate keyword ideas.
  33. service KeywordPlanIdeaService {
  34. option (google.api.default_host) = "googleads.googleapis.com";
  35. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  36. // Returns a list of keyword ideas.
  37. //
  38. // List of thrown errors:
  39. // [AuthenticationError]()
  40. // [AuthorizationError]()
  41. // [CollectionSizeError]()
  42. // [HeaderError]()
  43. // [InternalError]()
  44. // [KeywordPlanIdeaError]()
  45. // [QuotaError]()
  46. // [RequestError]()
  47. rpc GenerateKeywordIdeas(GenerateKeywordIdeasRequest) returns (GenerateKeywordIdeaResponse) {
  48. option (google.api.http) = {
  49. post: "/v12/customers/{customer_id=*}:generateKeywordIdeas"
  50. body: "*"
  51. };
  52. }
  53. // Returns a list of keyword historical metrics.
  54. //
  55. // List of thrown errors:
  56. // [AuthenticationError]()
  57. // [AuthorizationError]()
  58. // [CollectionSizeError]()
  59. // [HeaderError]()
  60. // [InternalError]()
  61. // [QuotaError]()
  62. // [RequestError]()
  63. rpc GenerateKeywordHistoricalMetrics(GenerateKeywordHistoricalMetricsRequest) returns (GenerateKeywordHistoricalMetricsResponse) {
  64. option (google.api.http) = {
  65. post: "/v12/customers/{customer_id=*}:generateKeywordHistoricalMetrics"
  66. body: "*"
  67. };
  68. }
  69. // Returns a list of suggested AdGroups and suggested modifications
  70. // (text, match type) for the given keywords.
  71. //
  72. // List of thrown errors:
  73. // [AuthenticationError]()
  74. // [AuthorizationError]()
  75. // [CollectionSizeError]()
  76. // [HeaderError]()
  77. // [InternalError]()
  78. // [QuotaError]()
  79. // [RequestError]()
  80. rpc GenerateAdGroupThemes(GenerateAdGroupThemesRequest) returns (GenerateAdGroupThemesResponse) {
  81. option (google.api.http) = {
  82. post: "/v12/customers/{customer_id=*}:generateAdGroupThemes"
  83. body: "*"
  84. };
  85. }
  86. }
  87. // Request message for [KeywordPlanIdeaService.GenerateKeywordIdeas][google.ads.googleads.v12.services.KeywordPlanIdeaService.GenerateKeywordIdeas].
  88. message GenerateKeywordIdeasRequest {
  89. // The ID of the customer with the recommendation.
  90. string customer_id = 1;
  91. // The resource name of the language to target.
  92. // Each keyword belongs to some set of languages; a keyword is included if
  93. // language is one of its languages.
  94. // If not set, all keywords will be included.
  95. optional string language = 14;
  96. // The resource names of the location to target. Maximum is 10.
  97. // An empty list MAY be used to specify all targeting geos.
  98. repeated string geo_target_constants = 15;
  99. // If true, adult keywords will be included in response.
  100. // The default value is false.
  101. bool include_adult_keywords = 10;
  102. // Token of the page to retrieve. If not specified, the first
  103. // page of results will be returned. To request next page of results use the
  104. // value obtained from `next_page_token` in the previous response.
  105. // The request fields must match across pages.
  106. string page_token = 12;
  107. // Number of results to retrieve in a single page.
  108. // A maximum of 10,000 results may be returned, if the page_size
  109. // exceeds this, it is ignored.
  110. // If unspecified, at most 10,000 results will be returned.
  111. // The server may decide to further limit the number of returned resources.
  112. // If the response contains fewer than 10,000 results it may not be assumed
  113. // as last page of results.
  114. int32 page_size = 13;
  115. // Targeting network.
  116. // If not set, Google Search And Partners Network will be used.
  117. google.ads.googleads.v12.enums.KeywordPlanNetworkEnum.KeywordPlanNetwork keyword_plan_network = 9;
  118. // The keyword annotations to include in response.
  119. repeated google.ads.googleads.v12.enums.KeywordPlanKeywordAnnotationEnum.KeywordPlanKeywordAnnotation keyword_annotation = 17;
  120. // The aggregate fields to include in response.
  121. google.ads.googleads.v12.common.KeywordPlanAggregateMetrics aggregate_metrics = 16;
  122. // The options for historical metrics data.
  123. google.ads.googleads.v12.common.HistoricalMetricsOptions historical_metrics_options = 18;
  124. // The type of seed to generate keyword ideas.
  125. oneof seed {
  126. // A Keyword and a specific Url to generate ideas from
  127. // for example, cars, www.example.com/cars.
  128. KeywordAndUrlSeed keyword_and_url_seed = 2;
  129. // A Keyword or phrase to generate ideas from, for example, cars.
  130. KeywordSeed keyword_seed = 3;
  131. // A specific url to generate ideas from, for example, www.example.com/cars.
  132. UrlSeed url_seed = 5;
  133. // The site to generate ideas from, for example, www.example.com.
  134. SiteSeed site_seed = 11;
  135. }
  136. }
  137. // Keyword And Url Seed
  138. message KeywordAndUrlSeed {
  139. // The URL to crawl in order to generate keyword ideas.
  140. optional string url = 3;
  141. // Requires at least one keyword.
  142. repeated string keywords = 4;
  143. }
  144. // Keyword Seed
  145. message KeywordSeed {
  146. // Requires at least one keyword.
  147. repeated string keywords = 2;
  148. }
  149. // Site Seed
  150. message SiteSeed {
  151. // The domain name of the site. If the customer requesting the ideas doesn't
  152. // own the site provided only public information is returned.
  153. optional string site = 2;
  154. }
  155. // Url Seed
  156. message UrlSeed {
  157. // The URL to crawl in order to generate keyword ideas.
  158. optional string url = 2;
  159. }
  160. // Response message for [KeywordPlanIdeaService.GenerateKeywordIdeas][google.ads.googleads.v12.services.KeywordPlanIdeaService.GenerateKeywordIdeas].
  161. message GenerateKeywordIdeaResponse {
  162. // Results of generating keyword ideas.
  163. repeated GenerateKeywordIdeaResult results = 1;
  164. // The aggregate metrics for all keyword ideas.
  165. google.ads.googleads.v12.common.KeywordPlanAggregateMetricResults aggregate_metric_results = 4;
  166. // Pagination token used to retrieve the next page of results.
  167. // Pass the content of this string as the `page_token` attribute of
  168. // the next request.
  169. // `next_page_token` is not returned for the last page.
  170. string next_page_token = 2;
  171. // Total number of results available.
  172. int64 total_size = 3;
  173. }
  174. // The result of generating keyword ideas.
  175. message GenerateKeywordIdeaResult {
  176. // Text of the keyword idea.
  177. // As in Keyword Plan historical metrics, this text may not be an actual
  178. // keyword, but the canonical form of multiple keywords.
  179. // See KeywordPlanKeywordHistoricalMetrics message in KeywordPlanService.
  180. optional string text = 5;
  181. // The historical metrics for the keyword.
  182. google.ads.googleads.v12.common.KeywordPlanHistoricalMetrics keyword_idea_metrics = 3;
  183. // The annotations for the keyword.
  184. // The annotation data is only provided if requested.
  185. google.ads.googleads.v12.common.KeywordAnnotations keyword_annotations = 6;
  186. // The list of close variants from the requested keywords that
  187. // are combined into this GenerateKeywordIdeaResult. See
  188. // https://support.google.com/google-ads/answer/9342105 for the
  189. // definition of "close variants".
  190. repeated string close_variants = 7;
  191. }
  192. // Request message for
  193. // [KeywordPlanIdeaService.GenerateKeywordHistoricalMetrics][google.ads.googleads.v12.services.KeywordPlanIdeaService.GenerateKeywordHistoricalMetrics].
  194. message GenerateKeywordHistoricalMetricsRequest {
  195. // The ID of the customer with the recommendation.
  196. string customer_id = 1;
  197. // A list of keywords to get historical metrics.
  198. // Not all inputs will be returned as a result of near-exact deduplication.
  199. // For example, if stats for "car" and "cars" are requested, only "car" will
  200. // be returned.
  201. // A maximum of 10,000 keywords can be used.
  202. repeated string keywords = 2;
  203. // The resource name of the language to target.
  204. // Each keyword belongs to some set of languages; a keyword is included if
  205. // language is one of its languages.
  206. // If not set, all keywords will be included.
  207. optional string language = 4;
  208. // If true, adult keywords will be included in response.
  209. // The default value is false.
  210. bool include_adult_keywords = 5;
  211. // The resource names of the location to target. Maximum is 10.
  212. // An empty list MAY be used to specify all targeting geos.
  213. repeated string geo_target_constants = 6;
  214. // Targeting network.
  215. // If not set, Google Search And Partners Network will be used.
  216. google.ads.googleads.v12.enums.KeywordPlanNetworkEnum.KeywordPlanNetwork keyword_plan_network = 7;
  217. // The aggregate fields to include in response.
  218. google.ads.googleads.v12.common.KeywordPlanAggregateMetrics aggregate_metrics = 8;
  219. // The options for historical metrics data.
  220. google.ads.googleads.v12.common.HistoricalMetricsOptions historical_metrics_options = 3;
  221. }
  222. // Response message for
  223. // [KeywordPlanIdeaService.GenerateKeywordHistoricalMetrics][google.ads.googleads.v12.services.KeywordPlanIdeaService.GenerateKeywordHistoricalMetrics].
  224. message GenerateKeywordHistoricalMetricsResponse {
  225. // List of keywords and their historical metrics.
  226. repeated GenerateKeywordHistoricalMetricsResult results = 1;
  227. // The aggregate metrics for all keywords.
  228. google.ads.googleads.v12.common.KeywordPlanAggregateMetricResults aggregate_metric_results = 2;
  229. }
  230. // The result of generating keyword historical metrics.
  231. message GenerateKeywordHistoricalMetricsResult {
  232. // The text of the query associated with one or more keywords.
  233. // Note that we de-dupe your keywords list, eliminating close variants
  234. // before returning the keywords as text. For example, if your request
  235. // originally contained the keywords "car" and "cars", the returned search
  236. // query will only contain "cars". The list of de-duped queries will be
  237. // included in close_variants field.
  238. optional string text = 1;
  239. // The list of close variants from the requested keywords whose stats
  240. // are combined into this GenerateKeywordHistoricalMetricsResult.
  241. repeated string close_variants = 3;
  242. // The historical metrics for text and its close variants
  243. google.ads.googleads.v12.common.KeywordPlanHistoricalMetrics keyword_metrics = 2;
  244. }
  245. // Request message for
  246. // [KeywordPlanIdeaService.GenerateAdGroupThemes][google.ads.googleads.v12.services.KeywordPlanIdeaService.GenerateAdGroupThemes].
  247. message GenerateAdGroupThemesRequest {
  248. // Required. The ID of the customer.
  249. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  250. // Required. A list of keywords to group into the provided AdGroups.
  251. repeated string keywords = 2 [(google.api.field_behavior) = REQUIRED];
  252. // Required. A list of resource names of AdGroups to group keywords into.
  253. // Resource name format: `customers/{customer_id}/adGroups/{ad_group_id}`
  254. repeated string ad_groups = 3 [(google.api.field_behavior) = REQUIRED];
  255. }
  256. // Response message for
  257. // [KeywordPlanIdeaService.GenerateAdGroupThemes][google.ads.googleads.v12.services.KeywordPlanIdeaService.GenerateAdGroupThemes].
  258. message GenerateAdGroupThemesResponse {
  259. // A list of suggested AdGroup/keyword pairings.
  260. repeated AdGroupKeywordSuggestion ad_group_keyword_suggestions = 1;
  261. // A list of provided AdGroups that could not be used as suggestions.
  262. repeated UnusableAdGroup unusable_ad_groups = 2;
  263. }
  264. // The suggested text and AdGroup/Campaign pairing for a given keyword.
  265. message AdGroupKeywordSuggestion {
  266. // The original keyword text.
  267. string keyword_text = 1;
  268. // The normalized version of keyword_text for BROAD/EXACT/PHRASE suggestions.
  269. string suggested_keyword_text = 2;
  270. // The suggested keyword match type.
  271. google.ads.googleads.v12.enums.KeywordMatchTypeEnum.KeywordMatchType suggested_match_type = 3;
  272. // The suggested AdGroup for the keyword.
  273. // Resource name format: `customers/{customer_id}/adGroups/{ad_group_id}`
  274. string suggested_ad_group = 4;
  275. // The suggested Campaign for the keyword.
  276. // Resource name format: `customers/{customer_id}/campaigns/{campaign_id}`
  277. string suggested_campaign = 5;
  278. }
  279. // An AdGroup/Campaign pair that could not be used as a suggestion for keywords.
  280. //
  281. // AdGroups may not be usable if the AdGroup
  282. //
  283. // * belongs to a Campaign that is not ENABLED or PAUSED
  284. // * is itself not ENABLED
  285. message UnusableAdGroup {
  286. // The AdGroup resource name.
  287. // Resource name format: `customers/{customer_id}/adGroups/{ad_group_id}`
  288. string ad_group = 1;
  289. // The Campaign resource name.
  290. // Resource name format: `customers/{customer_id}/campaigns/{campaign_id}`
  291. string campaign = 2;
  292. }