offline_user_data.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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.common;
  16. import "google/ads/googleads/v10/enums/user_identifier_source.proto";
  17. option csharp_namespace = "Google.Ads.GoogleAds.V10.Common";
  18. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v10/common;common";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "OfflineUserDataProto";
  21. option java_package = "com.google.ads.googleads.v10.common";
  22. option objc_class_prefix = "GAA";
  23. option php_namespace = "Google\\Ads\\GoogleAds\\V10\\Common";
  24. option ruby_package = "Google::Ads::GoogleAds::V10::Common";
  25. // Proto file describing offline user data.
  26. // Address identifier of offline data.
  27. message OfflineUserAddressInfo {
  28. // First name of the user, which is hashed as SHA-256 after normalized
  29. // (Lowercase all characters; Remove any extra spaces before, after, and in
  30. // between).
  31. optional string hashed_first_name = 7;
  32. // Last name of the user, which is hashed as SHA-256 after normalized (lower
  33. // case only and no punctuation).
  34. optional string hashed_last_name = 8;
  35. // City of the address. Only accepted for Store Sales and
  36. // ConversionAdjustmentUploadService.
  37. optional string city = 9;
  38. // State code of the address. Only accepted for Store Sales and
  39. // ConversionAdjustmentUploadService.
  40. optional string state = 10;
  41. // 2-letter country code in ISO-3166-1 alpha-2 of the user's address.
  42. optional string country_code = 11;
  43. // Postal code of the user's address.
  44. optional string postal_code = 12;
  45. // The street address of the user hashed using SHA-256 hash function after
  46. // normalization (lower case only). Only accepted for
  47. // ConversionAdjustmentUploadService.
  48. optional string hashed_street_address = 13;
  49. }
  50. // User identifying information.
  51. message UserIdentifier {
  52. // Source of the user identifier when the upload is from Store Sales,
  53. // ConversionUploadService, or ConversionAdjustmentUploadService.
  54. google.ads.googleads.v10.enums.UserIdentifierSourceEnum.UserIdentifierSource user_identifier_source = 6;
  55. // Exactly one must be specified. For OfflineUserDataJobService, Customer
  56. // Match accepts hashed_email, hashed_phone_number, mobile_id,
  57. // third_party_user_id, and address_info; Store Sales accepts hashed_email,
  58. // hashed_phone_number, third_party_user_id, and address_info.
  59. // ConversionUploadService accepts hashed_email and hashed_phone_number.
  60. // ConversionAdjustmentUploadService accepts hashed_email,
  61. // hashed_phone_number, and address_info.
  62. oneof identifier {
  63. // Hashed email address using SHA-256 hash function after normalization.
  64. // Accepted for Customer Match, Store Sales, ConversionUploadService, and
  65. // ConversionAdjustmentUploadService.
  66. string hashed_email = 7;
  67. // Hashed phone number using SHA-256 hash function after normalization
  68. // (E164 standard). Accepted for Customer Match, Store Sales,
  69. // ConversionUploadService, and ConversionAdjustmentUploadService.
  70. string hashed_phone_number = 8;
  71. // Mobile device ID (advertising ID/IDFA). Accepted only for Customer Match.
  72. string mobile_id = 9;
  73. // Advertiser-assigned user ID for Customer Match upload, or
  74. // third-party-assigned user ID for Store Sales. Accepted only for Customer
  75. // Match and Store Sales.
  76. string third_party_user_id = 10;
  77. // Address information. Accepted only for Customer Match, Store Sales, and
  78. // ConversionAdjustmentUploadService.
  79. OfflineUserAddressInfo address_info = 5;
  80. }
  81. }
  82. // Attribute of the store sales transaction.
  83. message TransactionAttribute {
  84. // Timestamp when transaction occurred. Required.
  85. // The format is "YYYY-MM-DD HH:MM:SS[+/-HH:MM]", where [+/-HH:MM] is an
  86. // optional timezone offset from UTC. If the offset is absent, the API will
  87. // use the account's timezone as default.
  88. // Examples: "2018-03-05 09:15:00" or "2018-02-01 14:34:30+03:00"
  89. optional string transaction_date_time = 8;
  90. // Transaction amount in micros. Required.
  91. // Transaction amount in micros needs to be greater than 1000.
  92. // If item Attributes are provided, it represents the total value of the
  93. // items, after multiplying the unit price per item by the quantity provided
  94. // in the ItemAttributes.
  95. optional double transaction_amount_micros = 9;
  96. // Transaction currency code. ISO 4217 three-letter code is used. Required.
  97. optional string currency_code = 10;
  98. // The resource name of conversion action to report conversions to.
  99. // Required.
  100. optional string conversion_action = 11;
  101. // Transaction order id.
  102. // Accessible only to customers on the allow-list.
  103. optional string order_id = 12;
  104. // Store attributes of the transaction.
  105. // Accessible only to customers on the allow-list.
  106. StoreAttribute store_attribute = 6;
  107. // Value of the custom variable for each transaction.
  108. // Accessible only to customers on the allow-list.
  109. optional string custom_value = 13;
  110. // Item attributes of the transaction.
  111. ItemAttribute item_attribute = 14;
  112. }
  113. // Store attributes of the transaction.
  114. message StoreAttribute {
  115. // Store code from
  116. // https://support.google.com/business/answer/3370250#storecode
  117. optional string store_code = 2;
  118. }
  119. // Item attributes of the transaction.
  120. message ItemAttribute {
  121. // A unique identifier of a product. It can be either the Merchant Center Item
  122. // ID or GTIN (Global Trade Item Number).
  123. string item_id = 1;
  124. // ID of the Merchant Center Account.
  125. optional int64 merchant_id = 2;
  126. // Common Locale Data Repository (CLDR) territory code of the country
  127. // associated with the feed where your items are uploaded. See
  128. // https://developers.google.com/google-ads/api/reference/data/codes-formats#country-codes
  129. // for more information.
  130. string country_code = 3;
  131. // ISO 639-1 code of the language associated with the feed where your items
  132. // are uploaded
  133. string language_code = 4;
  134. // The number of items sold. Defaults to 1 if not set.
  135. int64 quantity = 5;
  136. }
  137. // User data holding user identifiers and attributes.
  138. message UserData {
  139. // User identification info. Required.
  140. repeated UserIdentifier user_identifiers = 1;
  141. // Additional transactions/attributes associated with the user.
  142. // Required when updating store sales data.
  143. TransactionAttribute transaction_attribute = 2;
  144. // Additional attributes associated with the user. Required when updating
  145. // customer match attributes. These have an expiration of 540 days.
  146. UserAttribute user_attribute = 3;
  147. }
  148. // User attribute, can only be used with CUSTOMER_MATCH_WITH_ATTRIBUTES job
  149. // type.
  150. message UserAttribute {
  151. // Advertiser defined lifetime value for the user.
  152. optional int64 lifetime_value_micros = 1;
  153. // Advertiser defined lifetime value bucket for the user. The valid range for
  154. // a lifetime value bucket is from 1 (low) to 10 (high), except for remove
  155. // operation where 0 will also be accepted.
  156. optional int32 lifetime_value_bucket = 2;
  157. // Timestamp of the last purchase made by the user.
  158. // The format is YYYY-MM-DD HH:MM:SS[+/-HH:MM], where [+/-HH:MM] is an
  159. // optional timezone offset from UTC. If the offset is absent, the API will
  160. // use the account's timezone as default.
  161. string last_purchase_date_time = 3;
  162. // Advertiser defined average number of purchases that are made by the user in
  163. // a 30 day period.
  164. int32 average_purchase_count = 4;
  165. // Advertiser defined average purchase value in micros for the user.
  166. int64 average_purchase_value_micros = 5;
  167. // Timestamp when the user was acquired.
  168. // The format is YYYY-MM-DD HH:MM:SS[+/-HH:MM], where [+/-HH:MM] is an
  169. // optional timezone offset from UTC. If the offset is absent, the API will
  170. // use the account's timezone as default.
  171. string acquisition_date_time = 6;
  172. // The shopping loyalty related data. Shopping utilizes this data to provide
  173. // users with a better experience. Accessible only to merchants on the
  174. // allow-list with the user's consent.
  175. optional ShoppingLoyalty shopping_loyalty = 7;
  176. }
  177. // The shopping loyalty related data. Shopping utilizes this data to provide
  178. // users with a better experience.
  179. // Accessible only to merchants on the allow-list.
  180. message ShoppingLoyalty {
  181. // The membership tier. It is a free-form string as each merchant may have
  182. // their own loyalty system. For example, it could be a number from 1 to 10,
  183. // or a string such as "Golden" or "Silver", or even empty string "".
  184. optional string loyalty_tier = 1;
  185. }
  186. // Metadata for customer match user list.
  187. message CustomerMatchUserListMetadata {
  188. // The resource name of remarketing list to update data.
  189. // Required for job of CUSTOMER_MATCH_USER_LIST type.
  190. optional string user_list = 2;
  191. }
  192. // Metadata for Store Sales Direct.
  193. message StoreSalesMetadata {
  194. // This is the fraction of all transactions that are identifiable (i.e.,
  195. // associated with any form of customer information).
  196. // Required.
  197. // The fraction needs to be between 0 and 1 (excluding 0).
  198. optional double loyalty_fraction = 5;
  199. // This is the ratio of sales being uploaded compared to the overall sales
  200. // that can be associated with a customer. Required.
  201. // The fraction needs to be between 0 and 1 (excluding 0). For example, if you
  202. // upload half the sales that you are able to associate with a customer, this
  203. // would be 0.5.
  204. optional double transaction_upload_fraction = 6;
  205. // Name of the store sales custom variable key. A predefined key that
  206. // can be applied to the transaction and then later used for custom
  207. // segmentation in reporting.
  208. // Accessible only to customers on the allow-list.
  209. optional string custom_key = 7;
  210. // Metadata for a third party Store Sales upload.
  211. StoreSalesThirdPartyMetadata third_party_metadata = 3;
  212. }
  213. // Metadata for a third party Store Sales.
  214. // This product is only for customers on the allow-list. Please contact your
  215. // Google business development representative for details on the upload
  216. // configuration.
  217. message StoreSalesThirdPartyMetadata {
  218. // Time the advertiser uploaded the data to the partner. Required.
  219. // The format is "YYYY-MM-DD HH:MM:SS".
  220. // Examples: "2018-03-05 09:15:00" or "2018-02-01 14:34:30"
  221. optional string advertiser_upload_date_time = 7;
  222. // The fraction of transactions that are valid. Invalid transactions may
  223. // include invalid formats or values.
  224. // Required.
  225. // The fraction needs to be between 0 and 1 (excluding 0).
  226. optional double valid_transaction_fraction = 8;
  227. // The fraction of valid transactions that are matched to a third party
  228. // assigned user ID on the partner side.
  229. // Required.
  230. // The fraction needs to be between 0 and 1 (excluding 0).
  231. optional double partner_match_fraction = 9;
  232. // The fraction of valid transactions that are uploaded by the partner to
  233. // Google.
  234. // Required.
  235. // The fraction needs to be between 0 and 1 (excluding 0).
  236. optional double partner_upload_fraction = 10;
  237. // Version of partner IDs to be used for uploads. Required.
  238. optional string bridge_map_version_id = 11;
  239. // ID of the third party partner updating the transaction feed.
  240. optional int64 partner_id = 12;
  241. }