GAIEcommercePromotion.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*!
  2. @header GAIEcommercePromotion.h
  3. @abstract Google Analytics iOS SDK Hit Format Header
  4. @copyright Copyright 2014 Google Inc. All rights reserved.
  5. */
  6. #import <Foundation/Foundation.h>
  7. /*!
  8. * Class to construct promotion related fields for Google Analytics hits. The fields from this class
  9. * can be used to represent internal promotions that run within an app, such as banners, banner ads
  10. * etc.
  11. *
  12. * Typical usage:
  13. * <code>
  14. * GAIDictionaryBuilder *builder = [GAIDictionaryBuilder createScreenView];
  15. * GAIEcommercePromotion *promotion = [[GAIEcommercePromotion alloc] init];
  16. * [promotion setId:@"PROMO-ID1234"];
  17. * [promotion setName:@"Home screen banner"];
  18. * [builder set:kGAIPromotionClick forKey:kGAIPromotionAction];
  19. * [builder addPromotion:promotion];
  20. * [tracker send:builder.build]];
  21. * </code>
  22. */
  23. @interface GAIEcommercePromotion : NSObject
  24. /*!
  25. Sets the id that is used to identify a promotion in GA reports.
  26. */
  27. - (GAIEcommercePromotion *)setId:(NSString *)pid;
  28. /*!
  29. Sets the name that is used to identify a promotion in GA reports.
  30. */
  31. - (GAIEcommercePromotion *)setName:(NSString *)name;
  32. /*!
  33. Sets the name of the creative associated with the promotion.
  34. */
  35. - (GAIEcommercePromotion *)setCreative:(NSString *)creative;
  36. /*!
  37. Sets the position of the promotion.
  38. */
  39. - (GAIEcommercePromotion *)setPosition:(NSString *)position;
  40. /*!
  41. Builds an NSDictionary of fields stored in this instance. The index parameter is the
  42. index of this promotion in that promotion list.
  43. <br>
  44. Normally, users will have no need to call this method.
  45. */
  46. - (NSDictionary *)buildWithIndex:(NSUInteger)index;
  47. @end