conversion_upload_service.proto 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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.v11.services;
  16. import "google/ads/googleads/v11/common/offline_user_data.proto";
  17. import "google/ads/googleads/v11/enums/conversion_environment_enum.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/rpc/status.proto";
  23. option csharp_namespace = "Google.Ads.GoogleAds.V11.Services";
  24. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v11/services;services";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "ConversionUploadServiceProto";
  27. option java_package = "com.google.ads.googleads.v11.services";
  28. option objc_class_prefix = "GAA";
  29. option php_namespace = "Google\\Ads\\GoogleAds\\V11\\Services";
  30. option ruby_package = "Google::Ads::GoogleAds::V11::Services";
  31. // Service to upload conversions.
  32. service ConversionUploadService {
  33. option (google.api.default_host) = "googleads.googleapis.com";
  34. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  35. // Processes the given click conversions.
  36. //
  37. // List of thrown errors:
  38. // [AuthenticationError]()
  39. // [AuthorizationError]()
  40. // [ConversionUploadError]()
  41. // [HeaderError]()
  42. // [InternalError]()
  43. // [PartialFailureError]()
  44. // [QuotaError]()
  45. // [RequestError]()
  46. rpc UploadClickConversions(UploadClickConversionsRequest) returns (UploadClickConversionsResponse) {
  47. option (google.api.http) = {
  48. post: "/v11/customers/{customer_id=*}:uploadClickConversions"
  49. body: "*"
  50. };
  51. option (google.api.method_signature) = "customer_id,conversions,partial_failure";
  52. }
  53. // Processes the given call conversions.
  54. //
  55. // List of thrown errors:
  56. // [AuthenticationError]()
  57. // [AuthorizationError]()
  58. // [HeaderError]()
  59. // [InternalError]()
  60. // [PartialFailureError]()
  61. // [QuotaError]()
  62. // [RequestError]()
  63. rpc UploadCallConversions(UploadCallConversionsRequest) returns (UploadCallConversionsResponse) {
  64. option (google.api.http) = {
  65. post: "/v11/customers/{customer_id=*}:uploadCallConversions"
  66. body: "*"
  67. };
  68. option (google.api.method_signature) = "customer_id,conversions,partial_failure";
  69. }
  70. }
  71. // Request message for [ConversionUploadService.UploadClickConversions][google.ads.googleads.v11.services.ConversionUploadService.UploadClickConversions].
  72. message UploadClickConversionsRequest {
  73. // Required. The ID of the customer performing the upload.
  74. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  75. // Required. The conversions that are being uploaded.
  76. repeated ClickConversion conversions = 2 [(google.api.field_behavior) = REQUIRED];
  77. // Required. If true, successful operations will be carried out and invalid
  78. // operations will return errors. If false, all operations will be carried
  79. // out in one transaction if and only if they are all valid.
  80. // This should always be set to true.
  81. // See
  82. // https://developers.google.com/google-ads/api/docs/best-practices/partial-failures
  83. // for more information about partial failure.
  84. bool partial_failure = 3 [(google.api.field_behavior) = REQUIRED];
  85. // If true, the request is validated but not executed. Only errors are
  86. // returned, not results.
  87. bool validate_only = 4;
  88. }
  89. // Response message for [ConversionUploadService.UploadClickConversions][google.ads.googleads.v11.services.ConversionUploadService.UploadClickConversions].
  90. message UploadClickConversionsResponse {
  91. // Errors that pertain to conversion failures in the partial failure mode.
  92. // Returned when all errors occur inside the conversions. If any errors occur
  93. // outside the conversions (for example, auth errors), we return an RPC level
  94. // error. See
  95. // https://developers.google.com/google-ads/api/docs/best-practices/partial-failures
  96. // for more information about partial failure.
  97. google.rpc.Status partial_failure_error = 1;
  98. // Returned for successfully processed conversions. Proto will be empty for
  99. // rows that received an error. Results are not returned when validate_only is
  100. // true.
  101. repeated ClickConversionResult results = 2;
  102. }
  103. // Request message for [ConversionUploadService.UploadCallConversions][google.ads.googleads.v11.services.ConversionUploadService.UploadCallConversions].
  104. message UploadCallConversionsRequest {
  105. // Required. The ID of the customer performing the upload.
  106. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  107. // Required. The conversions that are being uploaded.
  108. repeated CallConversion conversions = 2 [(google.api.field_behavior) = REQUIRED];
  109. // Required. If true, successful operations will be carried out and invalid
  110. // operations will return errors. If false, all operations will be carried
  111. // out in one transaction if and only if they are all valid.
  112. // This should always be set to true.
  113. // See
  114. // https://developers.google.com/google-ads/api/docs/best-practices/partial-failures
  115. // for more information about partial failure.
  116. bool partial_failure = 3 [(google.api.field_behavior) = REQUIRED];
  117. // If true, the request is validated but not executed. Only errors are
  118. // returned, not results.
  119. bool validate_only = 4;
  120. }
  121. // Response message for [ConversionUploadService.UploadCallConversions][google.ads.googleads.v11.services.ConversionUploadService.UploadCallConversions].
  122. message UploadCallConversionsResponse {
  123. // Errors that pertain to conversion failures in the partial failure mode.
  124. // Returned when all errors occur inside the conversions. If any errors occur
  125. // outside the conversions (for example, auth errors), we return an RPC level
  126. // error. See
  127. // https://developers.google.com/google-ads/api/docs/best-practices/partial-failures
  128. // for more information about partial failure.
  129. google.rpc.Status partial_failure_error = 1;
  130. // Returned for successfully processed conversions. Proto will be empty for
  131. // rows that received an error. Results are not returned when validate_only is
  132. // true.
  133. repeated CallConversionResult results = 2;
  134. }
  135. // A click conversion.
  136. message ClickConversion {
  137. // The Google click ID (gclid) associated with this conversion.
  138. optional string gclid = 9;
  139. // The click identifier for clicks associated with app conversions and
  140. // originating from iOS devices starting with iOS14.
  141. string gbraid = 18;
  142. // The click identifier for clicks associated with web conversions and
  143. // originating from iOS devices starting with iOS14.
  144. string wbraid = 19;
  145. // Resource name of the conversion action associated with this conversion.
  146. // Note: Although this resource name consists of a customer id and a
  147. // conversion action id, validation will ignore the customer id and use the
  148. // conversion action id as the sole identifier of the conversion action.
  149. optional string conversion_action = 10;
  150. // The date time at which the conversion occurred. Must be after
  151. // the click time. The timezone must be specified. The format is
  152. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  153. optional string conversion_date_time = 11;
  154. // The value of the conversion for the advertiser.
  155. optional double conversion_value = 12;
  156. // Currency associated with the conversion value. This is the ISO 4217
  157. // 3-character currency code. For example: USD, EUR.
  158. optional string currency_code = 13;
  159. // The order ID associated with the conversion. An order id can only be used
  160. // for one conversion per conversion action.
  161. optional string order_id = 14;
  162. // Additional data about externally attributed conversions. This field
  163. // is required for conversions with an externally attributed conversion
  164. // action, but should not be set otherwise.
  165. ExternalAttributionData external_attribution_data = 7;
  166. // The custom variables associated with this conversion.
  167. repeated CustomVariable custom_variables = 15;
  168. // The cart data associated with this conversion.
  169. CartData cart_data = 16;
  170. // The user identifiers associated with this conversion. Only hashed_email and
  171. // hashed_phone_number are supported for conversion uploads. The maximum
  172. // number of user identifiers for each conversion is 5.
  173. repeated google.ads.googleads.v11.common.UserIdentifier user_identifiers = 17;
  174. // The environment this conversion was recorded on, for example, App or Web.
  175. google.ads.googleads.v11.enums.ConversionEnvironmentEnum.ConversionEnvironment conversion_environment = 20;
  176. }
  177. // A call conversion.
  178. message CallConversion {
  179. // The caller id from which this call was placed. Caller id is expected to be
  180. // in E.164 format with preceding '+' sign, for example, "+16502531234".
  181. optional string caller_id = 7;
  182. // The date time at which the call occurred. The timezone must be specified.
  183. // The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm",
  184. // for example, "2019-01-01 12:32:45-08:00".
  185. optional string call_start_date_time = 8;
  186. // Resource name of the conversion action associated with this conversion.
  187. // Note: Although this resource name consists of a customer id and a
  188. // conversion action id, validation will ignore the customer id and use the
  189. // conversion action id as the sole identifier of the conversion action.
  190. optional string conversion_action = 9;
  191. // The date time at which the conversion occurred. Must be after the call
  192. // time. The timezone must be specified. The format is
  193. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  194. optional string conversion_date_time = 10;
  195. // The value of the conversion for the advertiser.
  196. optional double conversion_value = 11;
  197. // Currency associated with the conversion value. This is the ISO 4217
  198. // 3-character currency code. For example: USD, EUR.
  199. optional string currency_code = 12;
  200. // The custom variables associated with this conversion.
  201. repeated CustomVariable custom_variables = 13;
  202. }
  203. // Contains additional information about externally attributed conversions.
  204. message ExternalAttributionData {
  205. // Represents the fraction of the conversion that is attributed to the
  206. // Google Ads click.
  207. optional double external_attribution_credit = 3;
  208. // Specifies the attribution model name.
  209. optional string external_attribution_model = 4;
  210. }
  211. // Identifying information for a successfully processed ClickConversion.
  212. message ClickConversionResult {
  213. // The Google Click ID (gclid) associated with this conversion.
  214. optional string gclid = 4;
  215. // The click identifier for clicks associated with app conversions and
  216. // originating from iOS devices starting with iOS14.
  217. string gbraid = 8;
  218. // The click identifier for clicks associated with web conversions and
  219. // originating from iOS devices starting with iOS14.
  220. string wbraid = 9;
  221. // Resource name of the conversion action associated with this conversion.
  222. optional string conversion_action = 5;
  223. // The date time at which the conversion occurred. The format is
  224. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  225. optional string conversion_date_time = 6;
  226. // The user identifiers associated with this conversion. Only hashed_email and
  227. // hashed_phone_number are supported for conversion uploads. The maximum
  228. // number of user identifiers for each conversion is 5.
  229. repeated google.ads.googleads.v11.common.UserIdentifier user_identifiers = 7;
  230. }
  231. // Identifying information for a successfully processed CallConversionUpload.
  232. message CallConversionResult {
  233. // The caller id from which this call was placed. Caller id is expected to be
  234. // in E.164 format with preceding '+' sign.
  235. optional string caller_id = 5;
  236. // The date time at which the call occurred. The format is
  237. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  238. optional string call_start_date_time = 6;
  239. // Resource name of the conversion action associated with this conversion.
  240. optional string conversion_action = 7;
  241. // The date time at which the conversion occurred. The format is
  242. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  243. optional string conversion_date_time = 8;
  244. }
  245. // A custom variable.
  246. message CustomVariable {
  247. // Resource name of the custom variable associated with this conversion.
  248. // Note: Although this resource name consists of a customer id and a
  249. // conversion custom variable id, validation will ignore the customer id and
  250. // use the conversion custom variable id as the sole identifier of the
  251. // conversion custom variable.
  252. string conversion_custom_variable = 1 [(google.api.resource_reference) = {
  253. type: "googleads.googleapis.com/ConversionCustomVariable"
  254. }];
  255. // The value string of this custom variable.
  256. // The value of the custom variable should not contain private customer data,
  257. // such as email addresses or phone numbers.
  258. string value = 2;
  259. }
  260. // Contains additional information about cart data.
  261. message CartData {
  262. // Contains data of the items purchased.
  263. message Item {
  264. // The shopping id of the item. Must be equal to the Merchant Center product
  265. // identifier.
  266. string product_id = 1;
  267. // Number of items sold.
  268. int32 quantity = 2;
  269. // Unit price excluding tax, shipping, and any transaction
  270. // level discounts. The currency code is the same as that in the
  271. // ClickConversion message.
  272. double unit_price = 3;
  273. }
  274. // The Merchant Center ID where the items are uploaded.
  275. int64 merchant_id = 6;
  276. // The country code associated with the feed where the items are uploaded.
  277. string feed_country_code = 2;
  278. // The language code associated with the feed where the items are uploaded.
  279. string feed_language_code = 3;
  280. // Sum of all transaction level discounts, such as free shipping and
  281. // coupon discounts for the whole cart. The currency code is the same
  282. // as that in the ClickConversion message.
  283. double local_transaction_cost = 4;
  284. // Data of the items purchased.
  285. repeated Item items = 5;
  286. }