conversion_adjustment_upload_service.proto 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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/offline_user_data.proto";
  17. import "google/ads/googleads/v12/enums/conversion_adjustment_type.proto";
  18. import "google/api/annotations.proto";
  19. import "google/api/client.proto";
  20. import "google/api/field_behavior.proto";
  21. import "google/rpc/status.proto";
  22. option csharp_namespace = "Google.Ads.GoogleAds.V12.Services";
  23. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v12/services;services";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "ConversionAdjustmentUploadServiceProto";
  26. option java_package = "com.google.ads.googleads.v12.services";
  27. option objc_class_prefix = "GAA";
  28. option php_namespace = "Google\\Ads\\GoogleAds\\V12\\Services";
  29. option ruby_package = "Google::Ads::GoogleAds::V12::Services";
  30. // Service to upload conversion adjustments.
  31. service ConversionAdjustmentUploadService {
  32. option (google.api.default_host) = "googleads.googleapis.com";
  33. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  34. // Processes the given conversion adjustments.
  35. //
  36. // List of thrown errors:
  37. // [AuthenticationError]()
  38. // [AuthorizationError]()
  39. // [HeaderError]()
  40. // [InternalError]()
  41. // [PartialFailureError]()
  42. // [QuotaError]()
  43. // [RequestError]()
  44. rpc UploadConversionAdjustments(UploadConversionAdjustmentsRequest) returns (UploadConversionAdjustmentsResponse) {
  45. option (google.api.http) = {
  46. post: "/v12/customers/{customer_id=*}:uploadConversionAdjustments"
  47. body: "*"
  48. };
  49. option (google.api.method_signature) = "customer_id,conversion_adjustments,partial_failure";
  50. }
  51. }
  52. // Request message for
  53. // [ConversionAdjustmentUploadService.UploadConversionAdjustments][google.ads.googleads.v12.services.ConversionAdjustmentUploadService.UploadConversionAdjustments].
  54. message UploadConversionAdjustmentsRequest {
  55. // Required. The ID of the customer performing the upload.
  56. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  57. // Required. The conversion adjustments that are being uploaded.
  58. repeated ConversionAdjustment conversion_adjustments = 2 [(google.api.field_behavior) = REQUIRED];
  59. // Required. If true, successful operations will be carried out and invalid
  60. // operations will return errors. If false, all operations will be carried out
  61. // in one transaction if and only if they are all valid. This should always be
  62. // set to true.
  63. // See
  64. // https://developers.google.com/google-ads/api/docs/best-practices/partial-failures
  65. // for more information about partial failure.
  66. bool partial_failure = 3 [(google.api.field_behavior) = REQUIRED];
  67. // If true, the request is validated but not executed. Only errors are
  68. // returned, not results.
  69. bool validate_only = 4;
  70. }
  71. // Response message for
  72. // [ConversionAdjustmentUploadService.UploadConversionAdjustments][google.ads.googleads.v12.services.ConversionAdjustmentUploadService.UploadConversionAdjustments].
  73. message UploadConversionAdjustmentsResponse {
  74. // Errors that pertain to conversion adjustment failures in the partial
  75. // failure mode. Returned when all errors occur inside the adjustments. If any
  76. // errors occur outside the adjustments (for example, auth errors), we return
  77. // an RPC level error. See
  78. // https://developers.google.com/google-ads/api/docs/best-practices/partial-failures
  79. // for more information about partial failure.
  80. google.rpc.Status partial_failure_error = 1;
  81. // Returned for successfully processed conversion adjustments. Proto will be
  82. // empty for rows that received an error. Results are not returned when
  83. // validate_only is true.
  84. repeated ConversionAdjustmentResult results = 2;
  85. }
  86. // A conversion adjustment.
  87. message ConversionAdjustment {
  88. // For adjustments, uniquely identifies a conversion that was reported
  89. // without an order ID specified. If the adjustment_type is ENHANCEMENT, this
  90. // value is optional but may be set in addition to the order_id.
  91. GclidDateTimePair gclid_date_time_pair = 12;
  92. // The order ID of the conversion to be adjusted. If the conversion was
  93. // reported with an order ID specified, that order ID must be used as the
  94. // identifier here. The order ID is required for enhancements.
  95. optional string order_id = 13;
  96. // Resource name of the conversion action associated with this conversion
  97. // adjustment. Note: Although this resource name consists of a customer id and
  98. // a conversion action id, validation will ignore the customer id and use the
  99. // conversion action id as the sole identifier of the conversion action.
  100. optional string conversion_action = 8;
  101. // The date time at which the adjustment occurred. Must be after the
  102. // conversion_date_time. The timezone must be specified. The format is
  103. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  104. optional string adjustment_date_time = 9;
  105. // The adjustment type.
  106. google.ads.googleads.v12.enums.ConversionAdjustmentTypeEnum.ConversionAdjustmentType adjustment_type = 5;
  107. // Information needed to restate the conversion's value.
  108. // Required for restatements. Should not be supplied for retractions. An error
  109. // will be returned if provided for a retraction.
  110. // NOTE: If you want to upload a second restatement with a different adjusted
  111. // value, it must have a new, more recent, adjustment occurrence time.
  112. // Otherwise, it will be treated as a duplicate of the previous restatement
  113. // and ignored.
  114. RestatementValue restatement_value = 6;
  115. // The user identifiers to enhance the original conversion.
  116. // ConversionAdjustmentUploadService only accepts user identifiers in
  117. // enhancements. The maximum number of user identifiers for each
  118. // enhancement is 5.
  119. repeated google.ads.googleads.v12.common.UserIdentifier user_identifiers = 10;
  120. // The user agent to enhance the original conversion. This can be found in
  121. // your user's HTTP request header when they convert on your web page.
  122. // Example, "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X)". User
  123. // agent can only be specified in enhancements with user identifiers. This
  124. // should match the user agent of the request that sent the original
  125. // conversion so the conversion and its enhancement are either both attributed
  126. // as same-device or both attributed as cross-device.
  127. optional string user_agent = 11;
  128. }
  129. // Contains information needed to restate a conversion's value.
  130. message RestatementValue {
  131. // The restated conversion value. This is the value of the conversion after
  132. // restatement. For example, to change the value of a conversion from 100 to
  133. // 70, an adjusted value of 70 should be reported.
  134. // NOTE: If you want to upload a second restatement with a different adjusted
  135. // value, it must have a new, more recent, adjustment occurrence time.
  136. // Otherwise, it will be treated as a duplicate of the previous restatement
  137. // and ignored.
  138. optional double adjusted_value = 3;
  139. // The currency of the restated value. If not provided, then the default
  140. // currency from the conversion action is used, and if that is not set then
  141. // the account currency is used. This is the ISO 4217 3-character currency
  142. // code for example, USD or EUR.
  143. optional string currency_code = 4;
  144. }
  145. // Uniquely identifies a conversion that was reported without an order ID
  146. // specified.
  147. message GclidDateTimePair {
  148. // Google click ID (gclid) associated with the original conversion for this
  149. // adjustment.
  150. optional string gclid = 3;
  151. // The date time at which the original conversion for this adjustment
  152. // occurred. The timezone must be specified. The format is "yyyy-mm-dd
  153. // hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  154. optional string conversion_date_time = 4;
  155. }
  156. // Information identifying a successfully processed ConversionAdjustment.
  157. message ConversionAdjustmentResult {
  158. // The gclid and conversion date time of the conversion.
  159. GclidDateTimePair gclid_date_time_pair = 9;
  160. // The order ID of the conversion to be adjusted.
  161. string order_id = 10;
  162. // Resource name of the conversion action associated with this conversion
  163. // adjustment.
  164. optional string conversion_action = 7;
  165. // The date time at which the adjustment occurred. The format is
  166. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  167. optional string adjustment_date_time = 8;
  168. // The adjustment type.
  169. google.ads.googleads.v12.enums.ConversionAdjustmentTypeEnum.ConversionAdjustmentType adjustment_type = 5;
  170. }