offline_user_data.proto 13 KB

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