keyword_plan_service.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  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.v10.services;
  16. import "google/ads/googleads/v10/common/keyword_plan_common.proto";
  17. import "google/ads/googleads/v10/resources/keyword_plan.proto";
  18. import "google/api/annotations.proto";
  19. import "google/api/client.proto";
  20. import "google/api/field_behavior.proto";
  21. import "google/api/resource.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/rpc/status.proto";
  24. option csharp_namespace = "Google.Ads.GoogleAds.V10.Services";
  25. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v10/services;services";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "KeywordPlanServiceProto";
  28. option java_package = "com.google.ads.googleads.v10.services";
  29. option objc_class_prefix = "GAA";
  30. option php_namespace = "Google\\Ads\\GoogleAds\\V10\\Services";
  31. option ruby_package = "Google::Ads::GoogleAds::V10::Services";
  32. // Proto file describing the keyword plan service.
  33. // Service to manage keyword plans.
  34. service KeywordPlanService {
  35. option (google.api.default_host) = "googleads.googleapis.com";
  36. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  37. // Creates, updates, or removes keyword plans. Operation statuses are
  38. // returned.
  39. //
  40. // List of thrown errors:
  41. // [AuthenticationError]()
  42. // [AuthorizationError]()
  43. // [DatabaseError]()
  44. // [FieldError]()
  45. // [HeaderError]()
  46. // [InternalError]()
  47. // [KeywordPlanError]()
  48. // [MutateError]()
  49. // [NewResourceCreationError]()
  50. // [QuotaError]()
  51. // [RequestError]()
  52. // [ResourceCountLimitExceededError]()
  53. // [StringLengthError]()
  54. rpc MutateKeywordPlans(MutateKeywordPlansRequest) returns (MutateKeywordPlansResponse) {
  55. option (google.api.http) = {
  56. post: "/v10/customers/{customer_id=*}/keywordPlans:mutate"
  57. body: "*"
  58. };
  59. option (google.api.method_signature) = "customer_id,operations";
  60. }
  61. // Returns the requested Keyword Plan forecast curve.
  62. // Only the bidding strategy is considered for generating forecast curve.
  63. // The bidding strategy value specified in the plan is ignored.
  64. //
  65. // To generate a forecast at a value specified in the plan, use
  66. // KeywordPlanService.GenerateForecastMetrics.
  67. //
  68. // List of thrown errors:
  69. // [AuthenticationError]()
  70. // [AuthorizationError]()
  71. // [HeaderError]()
  72. // [InternalError]()
  73. // [KeywordPlanError]()
  74. // [QuotaError]()
  75. // [RequestError]()
  76. rpc GenerateForecastCurve(GenerateForecastCurveRequest) returns (GenerateForecastCurveResponse) {
  77. option (google.api.http) = {
  78. post: "/v10/{keyword_plan=customers/*/keywordPlans/*}:generateForecastCurve"
  79. body: "*"
  80. };
  81. option (google.api.method_signature) = "keyword_plan";
  82. }
  83. // Returns a forecast in the form of a time series for the Keyword Plan over
  84. // the next 52 weeks.
  85. // (1) Forecasts closer to the current date are generally more accurate than
  86. // further out.
  87. //
  88. // (2) The forecast reflects seasonal trends using current and
  89. // prior traffic patterns. The forecast period of the plan is ignored.
  90. //
  91. // List of thrown errors:
  92. // [AuthenticationError]()
  93. // [AuthorizationError]()
  94. // [HeaderError]()
  95. // [InternalError]()
  96. // [KeywordPlanError]()
  97. // [QuotaError]()
  98. // [RequestError]()
  99. rpc GenerateForecastTimeSeries(GenerateForecastTimeSeriesRequest) returns (GenerateForecastTimeSeriesResponse) {
  100. option (google.api.http) = {
  101. post: "/v10/{keyword_plan=customers/*/keywordPlans/*}:generateForecastTimeSeries"
  102. body: "*"
  103. };
  104. option (google.api.method_signature) = "keyword_plan";
  105. }
  106. // Returns the requested Keyword Plan forecasts.
  107. //
  108. // List of thrown errors:
  109. // [AuthenticationError]()
  110. // [AuthorizationError]()
  111. // [HeaderError]()
  112. // [InternalError]()
  113. // [KeywordPlanError]()
  114. // [QuotaError]()
  115. // [RequestError]()
  116. rpc GenerateForecastMetrics(GenerateForecastMetricsRequest) returns (GenerateForecastMetricsResponse) {
  117. option (google.api.http) = {
  118. post: "/v10/{keyword_plan=customers/*/keywordPlans/*}:generateForecastMetrics"
  119. body: "*"
  120. };
  121. option (google.api.method_signature) = "keyword_plan";
  122. }
  123. // Returns the requested Keyword Plan historical metrics.
  124. //
  125. // List of thrown errors:
  126. // [AuthenticationError]()
  127. // [AuthorizationError]()
  128. // [HeaderError]()
  129. // [InternalError]()
  130. // [KeywordPlanError]()
  131. // [QuotaError]()
  132. // [RequestError]()
  133. rpc GenerateHistoricalMetrics(GenerateHistoricalMetricsRequest) returns (GenerateHistoricalMetricsResponse) {
  134. option (google.api.http) = {
  135. post: "/v10/{keyword_plan=customers/*/keywordPlans/*}:generateHistoricalMetrics"
  136. body: "*"
  137. };
  138. option (google.api.method_signature) = "keyword_plan";
  139. }
  140. }
  141. // Request message for [KeywordPlanService.MutateKeywordPlans][google.ads.googleads.v10.services.KeywordPlanService.MutateKeywordPlans].
  142. message MutateKeywordPlansRequest {
  143. // Required. The ID of the customer whose keyword plans are being modified.
  144. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  145. // Required. The list of operations to perform on individual keyword plans.
  146. repeated KeywordPlanOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  147. // If true, successful operations will be carried out and invalid
  148. // operations will return errors. If false, all operations will be carried
  149. // out in one transaction if and only if they are all valid.
  150. // Default is false.
  151. bool partial_failure = 3;
  152. // If true, the request is validated but not executed. Only errors are
  153. // returned, not results.
  154. bool validate_only = 4;
  155. }
  156. // A single operation (create, update, remove) on a keyword plan.
  157. message KeywordPlanOperation {
  158. // The FieldMask that determines which resource fields are modified in an
  159. // update.
  160. google.protobuf.FieldMask update_mask = 4;
  161. // The mutate operation.
  162. oneof operation {
  163. // Create operation: No resource name is expected for the new keyword plan.
  164. google.ads.googleads.v10.resources.KeywordPlan create = 1;
  165. // Update operation: The keyword plan is expected to have a valid resource
  166. // name.
  167. google.ads.googleads.v10.resources.KeywordPlan update = 2;
  168. // Remove operation: A resource name for the removed keyword plan is
  169. // expected in this format:
  170. //
  171. // `customers/{customer_id}/keywordPlans/{keyword_plan_id}`
  172. string remove = 3 [(google.api.resource_reference) = {
  173. type: "googleads.googleapis.com/KeywordPlan"
  174. }];
  175. }
  176. }
  177. // Response message for a keyword plan mutate.
  178. message MutateKeywordPlansResponse {
  179. // Errors that pertain to operation failures in the partial failure mode.
  180. // Returned only when partial_failure = true and all errors occur inside the
  181. // operations. If any errors occur outside the operations (e.g. auth errors),
  182. // we return an RPC level error.
  183. google.rpc.Status partial_failure_error = 3;
  184. // All results for the mutate.
  185. repeated MutateKeywordPlansResult results = 2;
  186. }
  187. // The result for the keyword plan mutate.
  188. message MutateKeywordPlansResult {
  189. // Returned for successful operations.
  190. string resource_name = 1 [(google.api.resource_reference) = {
  191. type: "googleads.googleapis.com/KeywordPlan"
  192. }];
  193. }
  194. // Request message for [KeywordPlanService.GenerateForecastCurve][google.ads.googleads.v10.services.KeywordPlanService.GenerateForecastCurve].
  195. message GenerateForecastCurveRequest {
  196. // Required. The resource name of the keyword plan to be forecasted.
  197. string keyword_plan = 1 [
  198. (google.api.field_behavior) = REQUIRED,
  199. (google.api.resource_reference) = {
  200. type: "googleads.googleapis.com/KeywordPlan"
  201. }
  202. ];
  203. }
  204. // Response message for [KeywordPlanService.GenerateForecastCurve][google.ads.googleads.v10.services.KeywordPlanService.GenerateForecastCurve].
  205. message GenerateForecastCurveResponse {
  206. // List of forecast curves for the keyword plan campaign.
  207. // One maximum.
  208. repeated KeywordPlanCampaignForecastCurve campaign_forecast_curves = 1;
  209. }
  210. // Request message for [KeywordPlanService.GenerateForecastTimeSeries][google.ads.googleads.v10.services.KeywordPlanService.GenerateForecastTimeSeries].
  211. message GenerateForecastTimeSeriesRequest {
  212. // Required. The resource name of the keyword plan to be forecasted.
  213. string keyword_plan = 1 [
  214. (google.api.field_behavior) = REQUIRED,
  215. (google.api.resource_reference) = {
  216. type: "googleads.googleapis.com/KeywordPlan"
  217. }
  218. ];
  219. }
  220. // Response message for [KeywordPlanService.GenerateForecastTimeSeries][google.ads.googleads.v10.services.KeywordPlanService.GenerateForecastTimeSeries].
  221. message GenerateForecastTimeSeriesResponse {
  222. // List of weekly time series forecasts for the keyword plan campaign.
  223. // One maximum.
  224. repeated KeywordPlanWeeklyTimeSeriesForecast weekly_time_series_forecasts = 1;
  225. }
  226. // Request message for [KeywordPlanService.GenerateForecastMetrics][google.ads.googleads.v10.services.KeywordPlanService.GenerateForecastMetrics].
  227. message GenerateForecastMetricsRequest {
  228. // Required. The resource name of the keyword plan to be forecasted.
  229. string keyword_plan = 1 [
  230. (google.api.field_behavior) = REQUIRED,
  231. (google.api.resource_reference) = {
  232. type: "googleads.googleapis.com/KeywordPlan"
  233. }
  234. ];
  235. }
  236. // Response message for [KeywordPlanService.GenerateForecastMetrics][google.ads.googleads.v10.services.KeywordPlanService.GenerateForecastMetrics].
  237. message GenerateForecastMetricsResponse {
  238. // List of campaign forecasts.
  239. // One maximum.
  240. repeated KeywordPlanCampaignForecast campaign_forecasts = 1;
  241. // List of ad group forecasts.
  242. repeated KeywordPlanAdGroupForecast ad_group_forecasts = 2;
  243. // List of keyword forecasts.
  244. repeated KeywordPlanKeywordForecast keyword_forecasts = 3;
  245. }
  246. // A campaign forecast.
  247. message KeywordPlanCampaignForecast {
  248. // The resource name of the Keyword Plan campaign related to the forecast.
  249. //
  250. // `customers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}`
  251. optional string keyword_plan_campaign = 3;
  252. // The forecast for the Keyword Plan campaign.
  253. ForecastMetrics campaign_forecast = 2;
  254. }
  255. // An ad group forecast.
  256. message KeywordPlanAdGroupForecast {
  257. // The resource name of the Keyword Plan ad group related to the forecast.
  258. //
  259. // `customers/{customer_id}/keywordPlanAdGroups/{keyword_plan_ad_group_id}`
  260. optional string keyword_plan_ad_group = 3;
  261. // The forecast for the Keyword Plan ad group.
  262. ForecastMetrics ad_group_forecast = 2;
  263. }
  264. // A keyword forecast.
  265. message KeywordPlanKeywordForecast {
  266. // The resource name of the Keyword Plan keyword related to the forecast.
  267. //
  268. // `customers/{customer_id}/keywordPlanAdGroupKeywords/{keyword_plan_ad_group_keyword_id}`
  269. optional string keyword_plan_ad_group_keyword = 3;
  270. // The forecast for the Keyword Plan keyword.
  271. ForecastMetrics keyword_forecast = 2;
  272. }
  273. // The forecast curve for the campaign.
  274. message KeywordPlanCampaignForecastCurve {
  275. // The resource name of the Keyword Plan campaign related to the forecast.
  276. //
  277. // `customers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}`
  278. optional string keyword_plan_campaign = 3;
  279. // The max cpc bid forecast curve for the campaign.
  280. KeywordPlanMaxCpcBidForecastCurve max_cpc_bid_forecast_curve = 2;
  281. }
  282. // The max cpc bid forecast curve.
  283. message KeywordPlanMaxCpcBidForecastCurve {
  284. // The forecasts for the Keyword Plan campaign at different max CPC bids.
  285. repeated KeywordPlanMaxCpcBidForecast max_cpc_bid_forecasts = 1;
  286. }
  287. // The forecast of the campaign at a specific bid.
  288. message KeywordPlanMaxCpcBidForecast {
  289. // The max cpc bid in micros.
  290. optional int64 max_cpc_bid_micros = 3;
  291. // The forecast for the Keyword Plan campaign at the specific bid.
  292. ForecastMetrics max_cpc_bid_forecast = 2;
  293. }
  294. // The weekly time series forecast for the keyword plan campaign.
  295. message KeywordPlanWeeklyTimeSeriesForecast {
  296. // The resource name of the Keyword Plan campaign related to the forecast.
  297. //
  298. // `customers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}`
  299. optional string keyword_plan_campaign = 1;
  300. // The forecasts for the Keyword Plan campaign at different max CPC bids.
  301. repeated KeywordPlanWeeklyForecast weekly_forecasts = 2;
  302. }
  303. // The forecast of the campaign for the week starting start_date.
  304. message KeywordPlanWeeklyForecast {
  305. // The start date, in yyyy-mm-dd format. This date is inclusive.
  306. optional string start_date = 1;
  307. // The forecast for the Keyword Plan campaign for the week.
  308. ForecastMetrics forecast = 2;
  309. }
  310. // Forecast metrics.
  311. message ForecastMetrics {
  312. // Impressions
  313. optional double impressions = 7;
  314. // Ctr
  315. optional double ctr = 8;
  316. // AVG cpc
  317. optional int64 average_cpc = 9;
  318. // Clicks
  319. optional double clicks = 10;
  320. // Cost
  321. optional int64 cost_micros = 11;
  322. }
  323. // Request message for [KeywordPlanService.GenerateHistoricalMetrics][google.ads.googleads.v10.services.KeywordPlanService.GenerateHistoricalMetrics].
  324. message GenerateHistoricalMetricsRequest {
  325. // Required. The resource name of the keyword plan of which historical metrics are
  326. // requested.
  327. string keyword_plan = 1 [
  328. (google.api.field_behavior) = REQUIRED,
  329. (google.api.resource_reference) = {
  330. type: "googleads.googleapis.com/KeywordPlan"
  331. }
  332. ];
  333. // The aggregate fields to include in response.
  334. google.ads.googleads.v10.common.KeywordPlanAggregateMetrics aggregate_metrics = 2;
  335. // The options for historical metrics data.
  336. google.ads.googleads.v10.common.HistoricalMetricsOptions historical_metrics_options = 3;
  337. }
  338. // Response message for [KeywordPlanService.GenerateHistoricalMetrics][google.ads.googleads.v10.services.KeywordPlanService.GenerateHistoricalMetrics].
  339. message GenerateHistoricalMetricsResponse {
  340. // List of keyword historical metrics.
  341. repeated KeywordPlanKeywordHistoricalMetrics metrics = 1;
  342. // The aggregate metrics for all the keywords in the keyword planner plan.
  343. google.ads.googleads.v10.common.KeywordPlanAggregateMetricResults aggregate_metric_results = 2;
  344. }
  345. // A keyword historical metrics.
  346. message KeywordPlanKeywordHistoricalMetrics {
  347. // The text of the query associated with one or more ad_group_keywords in the
  348. // plan.
  349. //
  350. // Note that we de-dupe your keywords list, eliminating close variants before
  351. // returning the plan's keywords as text. For example, if your plan originally
  352. // contained the keywords 'car' and 'cars', the returned search query will
  353. // only contain 'cars'.
  354. // Starting V5, the list of de-duped queries will be included in
  355. // close_variants field.
  356. optional string search_query = 4;
  357. // The list of close variant queries for search_query whose search results
  358. // are combined into the search_query.
  359. repeated string close_variants = 3;
  360. // The historical metrics for the query associated with one or more
  361. // ad_group_keywords in the plan.
  362. google.ads.googleads.v10.common.KeywordPlanHistoricalMetrics keyword_metrics = 2;
  363. }