暫無描述

FIRParameterNames.h 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. /// @file FIRParameterNames.h
  2. ///
  3. /// Predefined event parameter names.
  4. ///
  5. /// Params supply information that contextualize Events. You can associate up to 25 unique Params
  6. /// with each Event type. Some Params are suggested below for certain common Events, but you are
  7. /// not limited to these. You may supply extra Params for suggested Events or custom Params for
  8. /// Custom events. Param names can be up to 40 characters long, may only contain alphanumeric
  9. /// characters and underscores ("_"), and must start with an alphabetic character. Param values can
  10. /// be up to 100 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and
  11. /// should not be used.
  12. #import <Foundation/Foundation.h>
  13. /// Game achievement ID (NSString).
  14. /// <pre>
  15. /// NSDictionary *params = @{
  16. /// kFIRParameterAchievementID : @"10_matches_won",
  17. /// // ...
  18. /// };
  19. /// </pre>
  20. static NSString *const kFIRParameterAchievementID NS_SWIFT_NAME(AnalyticsParameterAchievementID) =
  21. @"achievement_id";
  22. /// Ad Network Click ID (NSString). Used for network-specific click IDs which vary in format.
  23. /// <pre>
  24. /// NSDictionary *params = @{
  25. /// kFIRParameterAdNetworkClickID : @"1234567",
  26. /// // ...
  27. /// };
  28. /// </pre>
  29. static NSString *const kFIRParameterAdNetworkClickID
  30. NS_SWIFT_NAME(AnalyticsParameterAdNetworkClickID) = @"aclid";
  31. /// The store or affiliation from which this transaction occurred (NSString).
  32. /// <pre>
  33. /// NSDictionary *params = @{
  34. /// kFIRParameterAffiliation : @"Google Store",
  35. /// // ...
  36. /// };
  37. /// </pre>
  38. static NSString *const kFIRParameterAffiliation NS_SWIFT_NAME(AnalyticsParameterAffiliation) =
  39. @"affiliation";
  40. /// The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro to
  41. /// capture campaign information, otherwise can be populated by developer. Highly Recommended
  42. /// (NSString).
  43. /// <pre>
  44. /// NSDictionary *params = @{
  45. /// kFIRParameterCampaign : @"winter_promotion",
  46. /// // ...
  47. /// };
  48. /// </pre>
  49. static NSString *const kFIRParameterCampaign NS_SWIFT_NAME(AnalyticsParameterCampaign) =
  50. @"campaign";
  51. /// Character used in game (NSString).
  52. /// <pre>
  53. /// NSDictionary *params = @{
  54. /// kFIRParameterCharacter : @"beat_boss",
  55. /// // ...
  56. /// };
  57. /// </pre>
  58. static NSString *const kFIRParameterCharacter NS_SWIFT_NAME(AnalyticsParameterCharacter) =
  59. @"character";
  60. /// The checkout step (1..N) (unsigned 64-bit integer as NSNumber).
  61. /// <pre>
  62. /// NSDictionary *params = @{
  63. /// kFIRParameterCheckoutStep : @"1",
  64. /// // ...
  65. /// };
  66. /// </pre>
  67. static NSString *const kFIRParameterCheckoutStep NS_SWIFT_NAME(AnalyticsParameterCheckoutStep) =
  68. @"checkout_step";
  69. /// Some option on a step in an ecommerce flow (NSString).
  70. /// <pre>
  71. /// NSDictionary *params = @{
  72. /// kFIRParameterCheckoutOption : @"Visa",
  73. /// // ...
  74. /// };
  75. /// </pre>
  76. static NSString *const kFIRParameterCheckoutOption
  77. NS_SWIFT_NAME(AnalyticsParameterCheckoutOption) = @"checkout_option";
  78. /// Campaign content (NSString).
  79. static NSString *const kFIRParameterContent NS_SWIFT_NAME(AnalyticsParameterContent) = @"content";
  80. /// Type of content selected (NSString).
  81. /// <pre>
  82. /// NSDictionary *params = @{
  83. /// kFIRParameterContentType : @"news article",
  84. /// // ...
  85. /// };
  86. /// </pre>
  87. static NSString *const kFIRParameterContentType NS_SWIFT_NAME(AnalyticsParameterContentType) =
  88. @"content_type";
  89. /// Coupon code for a purchasable item (NSString).
  90. /// <pre>
  91. /// NSDictionary *params = @{
  92. /// kFIRParameterCoupon : @"zz123",
  93. /// // ...
  94. /// };
  95. /// </pre>
  96. static NSString *const kFIRParameterCoupon NS_SWIFT_NAME(AnalyticsParameterCoupon) = @"coupon";
  97. /// Campaign custom parameter (NSString). Used as a method of capturing custom data in a campaign.
  98. /// Use varies by network.
  99. /// <pre>
  100. /// NSDictionary *params = @{
  101. /// kFIRParameterCP1 : @"custom_data",
  102. /// // ...
  103. /// };
  104. /// </pre>
  105. static NSString *const kFIRParameterCP1 NS_SWIFT_NAME(AnalyticsParameterCP1) = @"cp1";
  106. /// The name of a creative used in a promotional spot (NSString).
  107. /// <pre>
  108. /// NSDictionary *params = @{
  109. /// kFIRParameterCreativeName : @"Summer Sale",
  110. /// // ...
  111. /// };
  112. /// </pre>
  113. static NSString *const kFIRParameterCreativeName NS_SWIFT_NAME(AnalyticsParameterCreativeName) =
  114. @"creative_name";
  115. /// The name of a creative slot (NSString).
  116. /// <pre>
  117. /// NSDictionary *params = @{
  118. /// kFIRParameterCreativeSlot : @"summer_banner2",
  119. /// // ...
  120. /// };
  121. /// </pre>
  122. static NSString *const kFIRParameterCreativeSlot NS_SWIFT_NAME(AnalyticsParameterCreativeSlot) =
  123. @"creative_slot";
  124. /// Purchase currency in 3-letter <a href="http://en.wikipedia.org/wiki/ISO_4217#Active_codes">
  125. /// ISO_4217</a> format (NSString).
  126. /// <pre>
  127. /// NSDictionary *params = @{
  128. /// kFIRParameterCurrency : @"USD",
  129. /// // ...
  130. /// };
  131. /// </pre>
  132. static NSString *const kFIRParameterCurrency NS_SWIFT_NAME(AnalyticsParameterCurrency) =
  133. @"currency";
  134. /// Flight or Travel destination (NSString).
  135. /// <pre>
  136. /// NSDictionary *params = @{
  137. /// kFIRParameterDestination : @"Mountain View, CA",
  138. /// // ...
  139. /// };
  140. /// </pre>
  141. static NSString *const kFIRParameterDestination NS_SWIFT_NAME(AnalyticsParameterDestination) =
  142. @"destination";
  143. /// The arrival date, check-out date or rental end date for the item. This should be in
  144. /// YYYY-MM-DD format (NSString).
  145. /// <pre>
  146. /// NSDictionary *params = @{
  147. /// kFIRParameterEndDate : @"2015-09-14",
  148. /// // ...
  149. /// };
  150. /// </pre>
  151. static NSString *const kFIRParameterEndDate NS_SWIFT_NAME(AnalyticsParameterEndDate) = @"end_date";
  152. /// Flight number for travel events (NSString).
  153. /// <pre>
  154. /// NSDictionary *params = @{
  155. /// kFIRParameterFlightNumber : @"ZZ800",
  156. /// // ...
  157. /// };
  158. /// </pre>
  159. static NSString *const kFIRParameterFlightNumber NS_SWIFT_NAME(AnalyticsParameterFlightNumber) =
  160. @"flight_number";
  161. /// Group/clan/guild ID (NSString).
  162. /// <pre>
  163. /// NSDictionary *params = @{
  164. /// kFIRParameterGroupID : @"g1",
  165. /// // ...
  166. /// };
  167. /// </pre>
  168. static NSString *const kFIRParameterGroupID NS_SWIFT_NAME(AnalyticsParameterGroupID) = @"group_id";
  169. /// Index of an item in a list (signed 64-bit integer as NSNumber).
  170. /// <pre>
  171. /// NSDictionary *params = @{
  172. /// kFIRParameterIndex : @(1),
  173. /// // ...
  174. /// };
  175. /// </pre>
  176. static NSString *const kFIRParameterIndex NS_SWIFT_NAME(AnalyticsParameterIndex) = @"index";
  177. /// Item brand (NSString).
  178. /// <pre>
  179. /// NSDictionary *params = @{
  180. /// kFIRParameterItemBrand : @"Google",
  181. /// // ...
  182. /// };
  183. /// </pre>
  184. static NSString *const kFIRParameterItemBrand NS_SWIFT_NAME(AnalyticsParameterItemBrand) =
  185. @"item_brand";
  186. /// Item category (NSString).
  187. /// <pre>
  188. /// NSDictionary *params = @{
  189. /// kFIRParameterItemCategory : @"t-shirts",
  190. /// // ...
  191. /// };
  192. /// </pre>
  193. static NSString *const kFIRParameterItemCategory NS_SWIFT_NAME(AnalyticsParameterItemCategory) =
  194. @"item_category";
  195. /// Item ID (NSString).
  196. /// <pre>
  197. /// NSDictionary *params = @{
  198. /// kFIRParameterItemID : @"p7654",
  199. /// // ...
  200. /// };
  201. /// </pre>
  202. static NSString *const kFIRParameterItemID NS_SWIFT_NAME(AnalyticsParameterItemID) = @"item_id";
  203. /// The Google <a href="https://developers.google.com/places/place-id">Place ID</a> (NSString) that
  204. /// corresponds to the associated item. Alternatively, you can supply your own custom Location ID.
  205. /// <pre>
  206. /// NSDictionary *params = @{
  207. /// kFIRParameterItemLocationID : @"ChIJiyj437sx3YAR9kUWC8QkLzQ",
  208. /// // ...
  209. /// };
  210. /// </pre>
  211. static NSString *const kFIRParameterItemLocationID
  212. NS_SWIFT_NAME(AnalyticsParameterItemLocationID) = @"item_location_id";
  213. /// Item name (NSString).
  214. /// <pre>
  215. /// NSDictionary *params = @{
  216. /// kFIRParameterItemName : @"abc",
  217. /// // ...
  218. /// };
  219. /// </pre>
  220. static NSString *const kFIRParameterItemName NS_SWIFT_NAME(AnalyticsParameterItemName) =
  221. @"item_name";
  222. /// The list in which the item was presented to the user (NSString).
  223. /// <pre>
  224. /// NSDictionary *params = @{
  225. /// kFIRParameterItemList : @"Search Results",
  226. /// // ...
  227. /// };
  228. /// </pre>
  229. static NSString *const kFIRParameterItemList NS_SWIFT_NAME(AnalyticsParameterItemList) =
  230. @"item_list";
  231. /// Item variant (NSString).
  232. /// <pre>
  233. /// NSDictionary *params = @{
  234. /// kFIRParameterItemVariant : @"Red",
  235. /// // ...
  236. /// };
  237. /// </pre>
  238. static NSString *const kFIRParameterItemVariant NS_SWIFT_NAME(AnalyticsParameterItemVariant) =
  239. @"item_variant";
  240. /// Level in game (signed 64-bit integer as NSNumber).
  241. /// <pre>
  242. /// NSDictionary *params = @{
  243. /// kFIRParameterLevel : @(42),
  244. /// // ...
  245. /// };
  246. /// </pre>
  247. static NSString *const kFIRParameterLevel NS_SWIFT_NAME(AnalyticsParameterLevel) = @"level";
  248. /// Location (NSString). The Google <a href="https://developers.google.com/places/place-id">Place ID
  249. /// </a> that corresponds to the associated event. Alternatively, you can supply your own custom
  250. /// Location ID.
  251. /// <pre>
  252. /// NSDictionary *params = @{
  253. /// kFIRParameterLocation : @"ChIJiyj437sx3YAR9kUWC8QkLzQ",
  254. /// // ...
  255. /// };
  256. /// </pre>
  257. static NSString *const kFIRParameterLocation NS_SWIFT_NAME(AnalyticsParameterLocation) =
  258. @"location";
  259. /// The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended
  260. /// (NSString).
  261. /// <pre>
  262. /// NSDictionary *params = @{
  263. /// kFIRParameterMedium : @"email",
  264. /// // ...
  265. /// };
  266. /// </pre>
  267. static NSString *const kFIRParameterMedium NS_SWIFT_NAME(AnalyticsParameterMedium) = @"medium";
  268. /// Number of nights staying at hotel (signed 64-bit integer as NSNumber).
  269. /// <pre>
  270. /// NSDictionary *params = @{
  271. /// kFIRParameterNumberOfNights : @(3),
  272. /// // ...
  273. /// };
  274. /// </pre>
  275. static NSString *const kFIRParameterNumberOfNights
  276. NS_SWIFT_NAME(AnalyticsParameterNumberOfNights) = @"number_of_nights";
  277. /// Number of passengers traveling (signed 64-bit integer as NSNumber).
  278. /// <pre>
  279. /// NSDictionary *params = @{
  280. /// kFIRParameterNumberOfPassengers : @(11),
  281. /// // ...
  282. /// };
  283. /// </pre>
  284. static NSString *const kFIRParameterNumberOfPassengers
  285. NS_SWIFT_NAME(AnalyticsParameterNumberOfPassengers) = @"number_of_passengers";
  286. /// Number of rooms for travel events (signed 64-bit integer as NSNumber).
  287. /// <pre>
  288. /// NSDictionary *params = @{
  289. /// kFIRParameterNumberOfRooms : @(2),
  290. /// // ...
  291. /// };
  292. /// </pre>
  293. static NSString *const kFIRParameterNumberOfRooms NS_SWIFT_NAME(AnalyticsParameterNumberOfRooms) =
  294. @"number_of_rooms";
  295. /// Flight or Travel origin (NSString).
  296. /// <pre>
  297. /// NSDictionary *params = @{
  298. /// kFIRParameterOrigin : @"Mountain View, CA",
  299. /// // ...
  300. /// };
  301. /// </pre>
  302. static NSString *const kFIRParameterOrigin NS_SWIFT_NAME(AnalyticsParameterOrigin) = @"origin";
  303. /// Purchase price (double as NSNumber).
  304. /// <pre>
  305. /// NSDictionary *params = @{
  306. /// kFIRParameterPrice : @(1.0),
  307. /// kFIRParameterCurrency : @"USD", // e.g. $1.00 USD
  308. /// // ...
  309. /// };
  310. /// </pre>
  311. static NSString *const kFIRParameterPrice NS_SWIFT_NAME(AnalyticsParameterPrice) = @"price";
  312. /// Purchase quantity (signed 64-bit integer as NSNumber).
  313. /// <pre>
  314. /// NSDictionary *params = @{
  315. /// kFIRParameterQuantity : @(1),
  316. /// // ...
  317. /// };
  318. /// </pre>
  319. static NSString *const kFIRParameterQuantity NS_SWIFT_NAME(AnalyticsParameterQuantity) =
  320. @"quantity";
  321. /// Score in game (signed 64-bit integer as NSNumber).
  322. /// <pre>
  323. /// NSDictionary *params = @{
  324. /// kFIRParameterScore : @(4200),
  325. /// // ...
  326. /// };
  327. /// </pre>
  328. static NSString *const kFIRParameterScore NS_SWIFT_NAME(AnalyticsParameterScore) = @"score";
  329. /// The search string/keywords used (NSString).
  330. /// <pre>
  331. /// NSDictionary *params = @{
  332. /// kFIRParameterSearchTerm : @"periodic table",
  333. /// // ...
  334. /// };
  335. /// </pre>
  336. static NSString *const kFIRParameterSearchTerm NS_SWIFT_NAME(AnalyticsParameterSearchTerm) =
  337. @"search_term";
  338. /// Shipping cost (double as NSNumber).
  339. /// <pre>
  340. /// NSDictionary *params = @{
  341. /// kFIRParameterShipping : @(9.50),
  342. /// kFIRParameterCurrency : @"USD", // e.g. $9.50 USD
  343. /// // ...
  344. /// };
  345. /// </pre>
  346. static NSString *const kFIRParameterShipping NS_SWIFT_NAME(AnalyticsParameterShipping) =
  347. @"shipping";
  348. /// Sign up method (NSString).
  349. /// <pre>
  350. /// NSDictionary *params = @{
  351. /// kFIRParameterSignUpMethod : @"google",
  352. /// // ...
  353. /// };
  354. /// </pre>
  355. ///
  356. /// <b>This constant has been deprecated. Use Method constant instead.</b>
  357. static NSString *const kFIRParameterSignUpMethod NS_SWIFT_NAME(AnalyticsParameterSignUpMethod) =
  358. @"sign_up_method";
  359. /// A particular approach used in an operation; for example, "facebook" or "email" in the context
  360. /// of a sign_up or login event. (NSString).
  361. /// <pre>
  362. /// NSDictionary *params = @{
  363. /// kFIRParameterMethod : @"google",
  364. /// // ...
  365. /// };
  366. /// </pre>
  367. static NSString *const kFIRParameterMethod NS_SWIFT_NAME(AnalyticsParameterMethod) = @"method";
  368. /// The origin of your traffic, such as an Ad network (for example, google) or partner (urban
  369. /// airship). Identify the advertiser, site, publication, etc. that is sending traffic to your
  370. /// property. Highly recommended (NSString).
  371. /// <pre>
  372. /// NSDictionary *params = @{
  373. /// kFIRParameterSource : @"InMobi",
  374. /// // ...
  375. /// };
  376. /// </pre>
  377. static NSString *const kFIRParameterSource NS_SWIFT_NAME(AnalyticsParameterSource) = @"source";
  378. /// The departure date, check-in date or rental start date for the item. This should be in
  379. /// YYYY-MM-DD format (NSString).
  380. /// <pre>
  381. /// NSDictionary *params = @{
  382. /// kFIRParameterStartDate : @"2015-09-14",
  383. /// // ...
  384. /// };
  385. /// </pre>
  386. static NSString *const kFIRParameterStartDate NS_SWIFT_NAME(AnalyticsParameterStartDate) =
  387. @"start_date";
  388. /// Tax amount (double as NSNumber).
  389. /// <pre>
  390. /// NSDictionary *params = @{
  391. /// kFIRParameterTax : @(1.0),
  392. /// kFIRParameterCurrency : @"USD", // e.g. $1.00 USD
  393. /// // ...
  394. /// };
  395. /// </pre>
  396. static NSString *const kFIRParameterTax NS_SWIFT_NAME(AnalyticsParameterTax) = @"tax";
  397. /// If you're manually tagging keyword campaigns, you should use utm_term to specify the keyword
  398. /// (NSString).
  399. /// <pre>
  400. /// NSDictionary *params = @{
  401. /// kFIRParameterTerm : @"game",
  402. /// // ...
  403. /// };
  404. /// </pre>
  405. static NSString *const kFIRParameterTerm NS_SWIFT_NAME(AnalyticsParameterTerm) = @"term";
  406. /// A single ID for a ecommerce group transaction (NSString).
  407. /// <pre>
  408. /// NSDictionary *params = @{
  409. /// kFIRParameterTransactionID : @"ab7236dd9823",
  410. /// // ...
  411. /// };
  412. /// </pre>
  413. static NSString *const kFIRParameterTransactionID NS_SWIFT_NAME(AnalyticsParameterTransactionID) =
  414. @"transaction_id";
  415. /// Travel class (NSString).
  416. /// <pre>
  417. /// NSDictionary *params = @{
  418. /// kFIRParameterTravelClass : @"business",
  419. /// // ...
  420. /// };
  421. /// </pre>
  422. static NSString *const kFIRParameterTravelClass NS_SWIFT_NAME(AnalyticsParameterTravelClass) =
  423. @"travel_class";
  424. /// A context-specific numeric value which is accumulated automatically for each event type. This is
  425. /// a general purpose parameter that is useful for accumulating a key metric that pertains to an
  426. /// event. Examples include revenue, distance, time and points. Value should be specified as signed
  427. /// 64-bit integer or double as NSNumber. Notes: Values for pre-defined currency-related events
  428. /// (such as @c kFIREventAddToCart) should be supplied using double as NSNumber and must be
  429. /// accompanied by a @c kFIRParameterCurrency parameter. The valid range of accumulated values is
  430. /// [-9,223,372,036,854.77, 9,223,372,036,854.77]. Supplying a non-numeric value, omitting the
  431. /// corresponding @c kFIRParameterCurrency parameter, or supplying an invalid
  432. /// <a href="https://goo.gl/qqX3J2">currency code</a> for conversion events will cause that
  433. /// conversion to be omitted from reporting.
  434. /// <pre>
  435. /// NSDictionary *params = @{
  436. /// kFIRParameterValue : @(3.99),
  437. /// kFIRParameterCurrency : @"USD", // e.g. $3.99 USD
  438. /// // ...
  439. /// };
  440. /// </pre>
  441. static NSString *const kFIRParameterValue NS_SWIFT_NAME(AnalyticsParameterValue) = @"value";
  442. /// Name of virtual currency type (NSString).
  443. /// <pre>
  444. /// NSDictionary *params = @{
  445. /// kFIRParameterVirtualCurrencyName : @"virtual_currency_name",
  446. /// // ...
  447. /// };
  448. /// </pre>
  449. static NSString *const kFIRParameterVirtualCurrencyName
  450. NS_SWIFT_NAME(AnalyticsParameterVirtualCurrencyName) = @"virtual_currency_name";
  451. /// The name of a level in a game (NSString).
  452. /// <pre>
  453. /// NSDictionary *params = @{
  454. /// kFIRParameterLevelName : @"room_1",
  455. /// // ...
  456. /// };
  457. /// </pre>
  458. static NSString *const kFIRParameterLevelName NS_SWIFT_NAME(AnalyticsParameterLevelName) =
  459. @"level_name";
  460. /// The result of an operation. Specify 1 to indicate success and 0 to indicate failure (unsigned
  461. /// integer as NSNumber).
  462. /// <pre>
  463. /// NSDictionary *params = @{
  464. /// kFIRParameterSuccess : @(1),
  465. /// // ...
  466. /// };
  467. /// </pre>
  468. static NSString *const kFIRParameterSuccess NS_SWIFT_NAME(AnalyticsParameterSuccess) = @"success";
  469. /// Indicates that the associated event should either extend the current session
  470. /// or start a new session if no session was active when the event was logged.
  471. /// Specify YES to extend the current session or to start a new session; any
  472. /// other value will not extend or start a session.
  473. /// <pre>
  474. /// NSDictionary *params = @{
  475. /// kFIRParameterExtendSession : @YES,
  476. /// // ...
  477. /// };
  478. /// </pre>
  479. static NSString *const kFIRParameterExtendSession NS_SWIFT_NAME(AnalyticsParameterExtendSession) =
  480. @"extend_session";