conversion_upload_service.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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_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.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 = "ConversionUploadServiceProto";
  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. // 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: "/v12/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: "/v12/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.v12.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. // If true, the API will perform all upload checks and return errors if
  89. // any are found. If false, it will perform only basic input validation,
  90. // skip subsequent upload checks, and return success even if no click
  91. // was found for the provided `user_identifiers`.
  92. //
  93. // This setting only affects Enhanced conversions for leads uploads that use
  94. // `user_identifiers` instead of `GCLID`, `GBRAID`, or `WBRAID`. When
  95. // uploading enhanced conversions for leads, you should upload all conversion
  96. // events to the API, including those that may not come from Google Ads
  97. // campaigns. The upload of an event that is not from a Google Ads campaign
  98. // will result in a `CLICK_NOT_FOUND` error if this field is set to `true`.
  99. // Since these errors are expected for such events, set this field to `false`
  100. // so you can confirm your uploads are properly formatted but ignore
  101. // `CLICK_NOT_FOUND` errors from all of the conversions that are not from a
  102. // Google Ads campaign. This will allow you to focus only on errors that you
  103. // can address.
  104. //
  105. // Default is false.
  106. bool debug_enabled = 5;
  107. }
  108. // Response message for [ConversionUploadService.UploadClickConversions][google.ads.googleads.v12.services.ConversionUploadService.UploadClickConversions].
  109. message UploadClickConversionsResponse {
  110. // Errors that pertain to conversion failures in the partial failure mode.
  111. // Returned when all errors occur inside the conversions. If any errors occur
  112. // outside the conversions (for example, auth errors), we return an RPC level
  113. // error. See
  114. // https://developers.google.com/google-ads/api/docs/best-practices/partial-failures
  115. // for more information about partial failure.
  116. google.rpc.Status partial_failure_error = 1;
  117. // Returned for successfully processed conversions. Proto will be empty for
  118. // rows that received an error. Results are not returned when validate_only is
  119. // true.
  120. repeated ClickConversionResult results = 2;
  121. }
  122. // Request message for [ConversionUploadService.UploadCallConversions][google.ads.googleads.v12.services.ConversionUploadService.UploadCallConversions].
  123. message UploadCallConversionsRequest {
  124. // Required. The ID of the customer performing the upload.
  125. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  126. // Required. The conversions that are being uploaded.
  127. repeated CallConversion conversions = 2 [(google.api.field_behavior) = REQUIRED];
  128. // Required. If true, successful operations will be carried out and invalid
  129. // operations will return errors. If false, all operations will be carried
  130. // out in one transaction if and only if they are all valid.
  131. // This should always be set to true.
  132. // See
  133. // https://developers.google.com/google-ads/api/docs/best-practices/partial-failures
  134. // for more information about partial failure.
  135. bool partial_failure = 3 [(google.api.field_behavior) = REQUIRED];
  136. // If true, the request is validated but not executed. Only errors are
  137. // returned, not results.
  138. bool validate_only = 4;
  139. }
  140. // Response message for [ConversionUploadService.UploadCallConversions][google.ads.googleads.v12.services.ConversionUploadService.UploadCallConversions].
  141. message UploadCallConversionsResponse {
  142. // Errors that pertain to conversion failures in the partial failure mode.
  143. // Returned when all errors occur inside the conversions. If any errors occur
  144. // outside the conversions (for example, auth errors), we return an RPC level
  145. // error. See
  146. // https://developers.google.com/google-ads/api/docs/best-practices/partial-failures
  147. // for more information about partial failure.
  148. google.rpc.Status partial_failure_error = 1;
  149. // Returned for successfully processed conversions. Proto will be empty for
  150. // rows that received an error. Results are not returned when validate_only is
  151. // true.
  152. repeated CallConversionResult results = 2;
  153. }
  154. // A click conversion.
  155. message ClickConversion {
  156. // The Google click ID (gclid) associated with this conversion.
  157. optional string gclid = 9;
  158. // The click identifier for clicks associated with app conversions and
  159. // originating from iOS devices starting with iOS14.
  160. string gbraid = 18;
  161. // The click identifier for clicks associated with web conversions and
  162. // originating from iOS devices starting with iOS14.
  163. string wbraid = 19;
  164. // Resource name of the conversion action associated with this conversion.
  165. // Note: Although this resource name consists of a customer id and a
  166. // conversion action id, validation will ignore the customer id and use the
  167. // conversion action id as the sole identifier of the conversion action.
  168. optional string conversion_action = 10;
  169. // The date time at which the conversion occurred. Must be after
  170. // the click time. The timezone must be specified. The format is
  171. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  172. optional string conversion_date_time = 11;
  173. // The value of the conversion for the advertiser.
  174. optional double conversion_value = 12;
  175. // Currency associated with the conversion value. This is the ISO 4217
  176. // 3-character currency code. For example: USD, EUR.
  177. optional string currency_code = 13;
  178. // The order ID associated with the conversion. An order id can only be used
  179. // for one conversion per conversion action.
  180. optional string order_id = 14;
  181. // Additional data about externally attributed conversions. This field
  182. // is required for conversions with an externally attributed conversion
  183. // action, but should not be set otherwise.
  184. ExternalAttributionData external_attribution_data = 7;
  185. // The custom variables associated with this conversion.
  186. repeated CustomVariable custom_variables = 15;
  187. // The cart data associated with this conversion.
  188. CartData cart_data = 16;
  189. // The user identifiers associated with this conversion. Only hashed_email and
  190. // hashed_phone_number are supported for conversion uploads. The maximum
  191. // number of user identifiers for each conversion is 5.
  192. repeated google.ads.googleads.v12.common.UserIdentifier user_identifiers = 17;
  193. // The environment this conversion was recorded on, for example, App or Web.
  194. google.ads.googleads.v12.enums.ConversionEnvironmentEnum.ConversionEnvironment conversion_environment = 20;
  195. }
  196. // A call conversion.
  197. message CallConversion {
  198. // The caller id from which this call was placed. Caller id is expected to be
  199. // in E.164 format with preceding '+' sign, for example, "+16502531234".
  200. optional string caller_id = 7;
  201. // The date time at which the call occurred. The timezone must be specified.
  202. // The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm",
  203. // for example, "2019-01-01 12:32:45-08:00".
  204. optional string call_start_date_time = 8;
  205. // Resource name of the conversion action associated with this conversion.
  206. // Note: Although this resource name consists of a customer id and a
  207. // conversion action id, validation will ignore the customer id and use the
  208. // conversion action id as the sole identifier of the conversion action.
  209. optional string conversion_action = 9;
  210. // The date time at which the conversion occurred. Must be after the call
  211. // time. The timezone must be specified. The format is
  212. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  213. optional string conversion_date_time = 10;
  214. // The value of the conversion for the advertiser.
  215. optional double conversion_value = 11;
  216. // Currency associated with the conversion value. This is the ISO 4217
  217. // 3-character currency code. For example: USD, EUR.
  218. optional string currency_code = 12;
  219. // The custom variables associated with this conversion.
  220. repeated CustomVariable custom_variables = 13;
  221. }
  222. // Contains additional information about externally attributed conversions.
  223. message ExternalAttributionData {
  224. // Represents the fraction of the conversion that is attributed to the
  225. // Google Ads click.
  226. optional double external_attribution_credit = 3;
  227. // Specifies the attribution model name.
  228. optional string external_attribution_model = 4;
  229. }
  230. // Identifying information for a successfully processed ClickConversion.
  231. message ClickConversionResult {
  232. // The Google Click ID (gclid) associated with this conversion.
  233. optional string gclid = 4;
  234. // The click identifier for clicks associated with app conversions and
  235. // originating from iOS devices starting with iOS14.
  236. string gbraid = 8;
  237. // The click identifier for clicks associated with web conversions and
  238. // originating from iOS devices starting with iOS14.
  239. string wbraid = 9;
  240. // Resource name of the conversion action associated with this conversion.
  241. optional string conversion_action = 5;
  242. // The date time at which the conversion occurred. The format is
  243. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  244. optional string conversion_date_time = 6;
  245. // The user identifiers associated with this conversion. Only hashed_email and
  246. // hashed_phone_number are supported for conversion uploads. The maximum
  247. // number of user identifiers for each conversion is 5.
  248. repeated google.ads.googleads.v12.common.UserIdentifier user_identifiers = 7;
  249. }
  250. // Identifying information for a successfully processed CallConversionUpload.
  251. message CallConversionResult {
  252. // The caller id from which this call was placed. Caller id is expected to be
  253. // in E.164 format with preceding '+' sign.
  254. optional string caller_id = 5;
  255. // The date time at which the call occurred. The format is
  256. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  257. optional string call_start_date_time = 6;
  258. // Resource name of the conversion action associated with this conversion.
  259. optional string conversion_action = 7;
  260. // The date time at which the conversion occurred. The format is
  261. // "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".
  262. optional string conversion_date_time = 8;
  263. }
  264. // A custom variable.
  265. message CustomVariable {
  266. // Resource name of the custom variable associated with this conversion.
  267. // Note: Although this resource name consists of a customer id and a
  268. // conversion custom variable id, validation will ignore the customer id and
  269. // use the conversion custom variable id as the sole identifier of the
  270. // conversion custom variable.
  271. string conversion_custom_variable = 1 [(google.api.resource_reference) = {
  272. type: "googleads.googleapis.com/ConversionCustomVariable"
  273. }];
  274. // The value string of this custom variable.
  275. // The value of the custom variable should not contain private customer data,
  276. // such as email addresses or phone numbers.
  277. string value = 2;
  278. }
  279. // Contains additional information about cart data.
  280. message CartData {
  281. // Contains data of the items purchased.
  282. message Item {
  283. // The shopping id of the item. Must be equal to the Merchant Center product
  284. // identifier.
  285. string product_id = 1;
  286. // Number of items sold.
  287. int32 quantity = 2;
  288. // Unit price excluding tax, shipping, and any transaction
  289. // level discounts. The currency code is the same as that in the
  290. // ClickConversion message.
  291. double unit_price = 3;
  292. }
  293. // The Merchant Center ID where the items are uploaded.
  294. int64 merchant_id = 6;
  295. // The country code associated with the feed where the items are uploaded.
  296. string feed_country_code = 2;
  297. // The language code associated with the feed where the items are uploaded.
  298. string feed_language_code = 3;
  299. // Sum of all transaction level discounts, such as free shipping and
  300. // coupon discounts for the whole cart. The currency code is the same
  301. // as that in the ClickConversion message.
  302. double local_transaction_cost = 4;
  303. // Data of the items purchased.
  304. repeated Item items = 5;
  305. }