Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.84 KB | None | 0 0
  1. diff --git a/Common/Categories/UIViewController+Errors.m b/Common/Categories/UIViewController+Errors.m
  2. index af06fb6..08a34ef 100644
  3. --- a/Common/Categories/UIViewController+Errors.m
  4. +++ b/Common/Categories/UIViewController+Errors.m
  5. @@ -80,7 +80,7 @@ static NSString * const kETsyUIViewControllerErrorDismissBlockKey = @"kETsyUIVie
  6.  
  7. if (self.analyticsName) {
  8. NSDictionary * attributes = @{@"error_message": message ?: @""};
  9. - [EtsyAnalytics trackEvent:@"displayed_error_banner" inView:self.analyticsName attributes:attributes];
  10. + [self.analyticsContext logAnalyticsEventNamed:@"displayed_error_banner" properties:attributes];
  11. }
  12. }
  13.  
  14. @@ -109,7 +109,8 @@ static NSString * const kETsyUIViewControllerErrorDismissBlockKey = @"kETsyUIVie
  15.  
  16. if (self.analyticsName) {
  17. NSDictionary * attributes = @{@"success_message": message ?: @""};
  18. - [EtsyAnalytics trackEvent:@"displayed_success_banner" inView:self.analyticsName attributes:attributes];
  19. + [self.analyticsContext logAnalyticsEventNamed:@"displayed_success_banner" properties:attributes];
  20. +
  21. }
  22. }
  23.  
  24. diff --git a/Common/Categories/UIViewController+Referrals.m b/Common/Categories/UIViewController+Referrals.m
  25. index 0478d6e..9ab7140 100644
  26. --- a/Common/Categories/UIViewController+Referrals.m
  27. +++ b/Common/Categories/UIViewController+Referrals.m
  28. @@ -141,8 +141,7 @@
  29. navController.toolbarHidden = NO;
  30. aboutController.dismissModalBarButtonItemStyle = EtsyDismissModalBarButtonItemStyleX;
  31.  
  32. - [EtsyAnalytics trackEvent:context action:@"invites_view_learn_more"
  33. - attributes:[referrals defaultEventProperties]];
  34. + [self.analyticsContext logAnalyticsEventNamed:@"invites_view_learn_more" properties:[referrals defaultEventProperties]];
  35. [referrals logMetric:@"invites_view_learn_more"
  36. withProperties:NSDictionaryOfVariableBindings(context)];
  37.  
  38. @@ -287,9 +286,7 @@
  39.  
  40. [referrals logMetric:@"invites_share_module" withProperties:eventAttributes];
  41.  
  42. - [EtsyAnalytics trackEvent:event
  43. - action:eventAction
  44. - attributes:eventAttributes];
  45. + [self.analyticsContext logAnalyticsEventNamed:eventAction properties:eventAttributes];
  46.  
  47. //
  48. // Event logging parity with web
  49. @@ -310,7 +307,7 @@
  50. if (secondaryLogEvent) {
  51. eventAttributes[@"share_action"] = action;
  52. [eventAttributes setObjectOrNil:context forKeyOrNil:@"share_context"];
  53. - [EtsyAnalytics trackPageview:secondaryLogEvent attributes:eventAttributes];
  54. + [self.analyticsContext logAnalyticsEventNamed:secondaryLogEvent properties:eventAttributes];
  55. }
  56. }
  57.  
  58. diff --git a/Common/Helpers/EtsyImageScrollViewVideoUtility.m b/Common/Helpers/EtsyImageScrollViewVideoUtility.m
  59. index 1a302ac..8f10c08 100644
  60. --- a/Common/Helpers/EtsyImageScrollViewVideoUtility.m
  61. +++ b/Common/Helpers/EtsyImageScrollViewVideoUtility.m
  62. @@ -23,6 +23,7 @@
  63. @property (nonatomic, assign) BOOL trackedPlay;
  64. @property (nonatomic, strong) id<EtsyObjectID> shopID;
  65. @property (nonatomic, strong) EtsyShopAboutVideo *aboutVideo;
  66. +@property (readonly, weak) EtsyAnalyticsContext *analyticsContext;
  67. @end
  68.  
  69. @implementation EtsyImageScrollViewVideoUtility
  70. @@ -37,7 +38,7 @@
  71.  
  72. NSDictionary *atrs = [self attributesForVideoPlayback];
  73.  
  74. - [EtsyAnalytics trackEvent:@"shop_about_video_tapped" inView:analyticsName attributes:atrs];
  75. + [self.analyticsContext logAnalyticsEventNamed:@"shop_about_video_tapped" properties:atrs];
  76. if(video) {
  77. if([EtsyEnvironmentInfo isIOS8OrHigher]) {
  78. AVPlayerViewController *playerVC = [[AVPlayerViewController alloc] init];
  79. @@ -48,10 +49,10 @@
  80. EK_STRONGIFY(playerVC);
  81. [playerVC.player play];
  82. if(playerVC.player.error) {
  83. - [EtsyAnalytics trackEvent:@"shop_about_video_playback_error" inView:analyticsName attributes:atrs];
  84. + [self.analyticsContext logAnalyticsEventNamed:@"shop_about_video_playback_error" properties:atrs];
  85. [[EtsyGraphite metricWithName:@"shop.about.video.playback_error"] increment];
  86. } else {
  87. - [EtsyAnalytics trackEvent:@"shop_about_video_played" inView:analyticsName attributes:atrs];
  88. + [self.analyticsContext logAnalyticsEventNamed:@"shop_about_video_played" properties:atrs];
  89. }
  90. }];
  91. } else {
  92. @@ -77,17 +78,13 @@
  93. if(state == MPMoviePlaybackStatePlaying && !self.trackedPlay) {
  94. self.trackedPlay = YES;
  95.  
  96. - [EtsyAnalytics trackEvent:@"shop_about_video_played"
  97. - inView:self.analyticsName
  98. - attributes:[self attributesForVideoPlayback]];
  99. + [self.analyticsContext logAnalyticsEventNamed:@"shop_about_video_played" properties:[self attributesForVideoPlayback]];
  100. }
  101. }
  102.  
  103. - (void)videoViewController:(UIViewController *)videoViewController didReceivePlaybackFinishedNotificationWithReason:(MPMovieFinishReason)reason error:(NSError *)error {
  104. if(error) {
  105. - [EtsyAnalytics trackEvent:@"shop_about_video_playback_error"
  106. - inView:self.analyticsName
  107. - attributes:[self attributesForVideoPlayback]];
  108. + [self.analyticsContext logAnalyticsEventNamed:@"shop_about_video_playback_error" properties:[self attributesForVideoPlayback]];
  109. [[EtsyGraphite metricWithName:@"shop.about.video.playback_error"] increment];
  110. }
  111. }
  112. diff --git a/Common/Sharing/Social Invites/EtsySocialInvitesToastView.m b/Common/Sharing/Social Invites/EtsySocialInvitesToastView.m
  113. index 355bb20..bdaf9db 100644
  114. --- a/Common/Sharing/Social Invites/EtsySocialInvitesToastView.m
  115. +++ b/Common/Sharing/Social Invites/EtsySocialInvitesToastView.m
  116. @@ -104,13 +104,13 @@ static const CGFloat kToastFontSize = 14;
  117.  
  118. if(show) {
  119. self.canHide = NO;
  120. - [EtsyAnalytics trackEvent:@"toast_shown" inView:@"social_invites" attributes:[self logAttributes]];
  121. + [self.analyticsContext logAnalyticsEventNamed:@"toast_shown" properties:[self logAttributes]];
  122. [[EtsyGraphite metricWithName:S(@"appgrowth.socialInvites.toast.show.%@", self.trigger) prefix:@"performance.native.ios"] increment];
  123. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(kEtsySocialInvitesToastMinimumDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  124. self.canHide = YES;
  125. });
  126. } else {
  127. - [EtsyAnalytics trackEvent:@"toast_ignored" inView:@"social_invites" attributes:[self logAttributes]];
  128. + [self.analyticsContext logAnalyticsEventNamed:@"toast_ignored" properties:[self logAttributes]];
  129. [[EtsyGraphite metricWithName:S(@"appgrowth.socialInvites.toast.ignored.%@", self.trigger) prefix:@"performance.native.ios"] increment];
  130. }
  131.  
  132. @@ -154,7 +154,7 @@ static const CGFloat kToastFontSize = 14;
  133. }
  134.  
  135. - (void)didTap {
  136. - [EtsyAnalytics trackEvent:@"toast_tapped" inView:@"social_invites" attributes:[self logAttributes]];
  137. + [self.analyticsContext logAnalyticsEventNamed:@"toast_tapped" properties:[self logAttributes]];
  138. [[EtsyGraphite metricWithName:S(@"appgrowth.socialInvites.toast.tapped.%@", self.trigger) prefix:@"performance.native.ios"] increment];
  139. if(self.tapped) {
  140. self.tapped(self);
  141. diff --git a/Libraries/facebook-ios-sdk b/Libraries/facebook-ios-sdk
  142. --- a/Libraries/facebook-ios-sdk
  143. +++ b/Libraries/facebook-ios-sdk
  144. @@ -1 +1 @@
  145. -Subproject commit a0e29cd3183079475c9484909f34e2d3739752f4
  146. +Subproject commit a0e29cd3183079475c9484909f34e2d3739752f4-dirty
  147. diff --git a/buyonetsy/Code/ActivityFeed/BOENewActivityFeedViewController.m b/buyonetsy/Code/ActivityFeed/BOENewActivityFeedViewController.m
  148. index 72acacf..514bbfd 100644
  149. --- a/buyonetsy/Code/ActivityFeed/BOENewActivityFeedViewController.m
  150. +++ b/buyonetsy/Code/ActivityFeed/BOENewActivityFeedViewController.m
  151. @@ -337,7 +337,7 @@ static const UIEdgeInsets kEtsyActivityFeedEdgeInsets = {kEtsyActivityFeedIPhone
  152.  
  153. NSDictionary *attributes = [EtsyAnalytics attributesForActivityFeedResponse:result pageNumber:resource.pageNumber];
  154.  
  155. - [EtsyAnalytics trackEvent:self.analyticsName action:@"activity_feed" attributes:attributes];
  156. + [self.analyticsContext logAnalyticsEventNamed:@"activity_feed" properties:attributes];
  157.  
  158. [self.view setNeedsLayout];
  159. }
  160. diff --git a/buyonetsy/Code/Cart+Checkout/BOECartCheckoutButtonView.m b/buyonetsy/Code/Cart+Checkout/BOECartCheckoutButtonView.m
  161. index 01d1b44..521be81 100644
  162. --- a/buyonetsy/Code/Cart+Checkout/BOECartCheckoutButtonView.m
  163. +++ b/buyonetsy/Code/Cart+Checkout/BOECartCheckoutButtonView.m
  164. @@ -169,7 +169,7 @@ static const CGFloat EtsyCartCellCheckoutButtonHeight = 50;
  165. #pragma MARK UITextViewDelegate
  166.  
  167. - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)url inRange:(NSRange)characterRange {
  168. - [EtsyAnalytics trackEvent:@"applepay_house_rules_link_clicked" inView:nil attributes:@{ @"URL": url.absoluteString }];
  169. + [self.analyticsContext logAnalyticsEventNamed:@"applepay_house_rules_link_clicked" properties:@{ @"URL": url.absoluteString }];
  170. return YES;
  171. }
  172.  
  173. diff --git a/buyonetsy/Code/FriendFinder/EtsyFriendFinderResultsController.m b/buyonetsy/Code/FriendFinder/EtsyFriendFinderResultsController.m
  174. index 6b97a7a..611b19b 100644
  175. --- a/buyonetsy/Code/FriendFinder/EtsyFriendFinderResultsController.m
  176. +++ b/buyonetsy/Code/FriendFinder/EtsyFriendFinderResultsController.m
  177. @@ -464,7 +464,7 @@ NSString *EtsyFindFriendsResultsReuseIdentifier = @"EtsyFindFriendsResultsReuseI
  178. LOG(@"Friend finder", @"Error following user: %@", error);
  179. }] load];
  180.  
  181. - [EtsyAnalytics trackEvent:@"friend_finder" action:@"friend_finder_follow_all_button_tapped" label:@"Follow"];
  182. + [self.analyticsContext logAnalyticsEventNamed:@"friend_finder_follow_all_button_tapped" properties:nil];
  183. } authReason:EtsyAuthReasonFollowAllFriends];
  184. }
  185.  
  186. diff --git a/buyonetsy/Code/FundOnEtsy/Onboarding/Controllers/BOEFundOnEtsyOnboardingViewController.m b/buyonetsy/Code/FundOnEtsy/Onboarding/Controllers/BOEFundOnEtsyOnboardingViewController.m
  187. index 983f208..a3564aa 100644
  188. --- a/buyonetsy/Code/FundOnEtsy/Onboarding/Controllers/BOEFundOnEtsyOnboardingViewController.m
  189. +++ b/buyonetsy/Code/FundOnEtsy/Onboarding/Controllers/BOEFundOnEtsyOnboardingViewController.m
  190. @@ -96,13 +96,13 @@ static CGFloat const kPageControlHeight = 35.f;
  191. [me orientationUpdated];
  192. } name:UIDeviceOrientationDidChangeNotification object:nil];
  193.  
  194. - [EtsyAnalytics trackPageview:self.analyticsName];
  195. + [self.analyticsContext logAnalyticsEventNamed:self.analyticsName properties:nil];
  196. }
  197.  
  198. - (void)viewDidAppear:(BOOL)animated {
  199. [super viewDidAppear:animated];
  200.  
  201. - [EtsyAnalytics trackEvent:@"fund_on_etsy_onboarding_show" inView:self.analyticsName];
  202. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_onboarding_show" properties:nil];
  203. }
  204.  
  205. - (void)orientationUpdated {
  206. @@ -185,12 +185,12 @@ static CGFloat const kPageControlHeight = 35.f;
  207. #pragma mark - FundOnEtsySlideshowCardViewDelegate
  208.  
  209. - (void)fundOnEtsySlideshowCardViewDidTapGotIt:(BOEFundOnEtsySlideshowCardView *)fundOnEtsySlideshowCardView {
  210. - [EtsyAnalytics trackEvent:@"fund_on_etsy_onboarding_got_it" inView:self.analyticsName];
  211. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_onboarding_got_it" properties:nil];
  212. [self dismissViewControllerAnimated:YES completion:nil];
  213. }
  214.  
  215. - (void)fundOnEtsySlideshowCardViewDidTapClose:(BOEFundOnEtsySlideshowCardView *)fundOnEtsySlideshowCardView {
  216. - [EtsyAnalytics trackEvent:@"fund_on_etsy_onboarding_dismiss" inView:self.analyticsName];
  217. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_onboarding_dismiss" properties:nil];
  218. [self dismissViewControllerAnimated:YES completion:nil];
  219. }
  220.  
  221. diff --git a/buyonetsy/Code/GiftCards/EtsyBuyGiftCardController.m b/buyonetsy/Code/GiftCards/EtsyBuyGiftCardController.m
  222. index 3c4f985..a88af06 100644
  223. --- a/buyonetsy/Code/GiftCards/EtsyBuyGiftCardController.m
  224. +++ b/buyonetsy/Code/GiftCards/EtsyBuyGiftCardController.m
  225. @@ -237,7 +237,7 @@ typedef enum {
  226.  
  227. [self relayout];
  228.  
  229. - [EtsyAnalytics trackPageview:@"buy_gift_card_view" attributes:@{@"is_updating_gift_card" : (_giftCardListing ? @1 : @0)}];
  230. + [self.analyticsContext logAnalyticsEventNamed:@"buy_gift_card_view" properties:@{@"is_updating_gift_card" : (_giftCardListing ? @1 : @0)}];
  231. }
  232.  
  233. - (void)layoutCarouselAndTextFieldsWithListing:(EtsyCartListing *)listing
  234. @@ -488,14 +488,14 @@ typedef enum {
  235. if ([_delegate respondsToSelector:@selector(didUpdateGiftCard:)])
  236. [_delegate didUpdateGiftCard:cart];
  237.  
  238. - [EtsyAnalytics trackEvent:@"buy_gift_card_view" action:@"updated_gift_card" label:nil value:0 attributes:trackingAttributes];
  239. + [self.analyticsContext logAnalyticsEventNamed:@"updated_gift_card" properties:trackingAttributes];
  240. }
  241. else
  242. {
  243. if ([_delegate respondsToSelector:@selector(didBuyGiftCard)])
  244. [_delegate didBuyGiftCard];
  245.  
  246. - [EtsyAnalytics trackEvent:@"buy_gift_card_view" action:@"added_gift_card_to_cart" label:nil value:0 attributes:trackingAttributes];
  247. + [self.analyticsContext logAnalyticsEventNamed:@"added_gift_card_to_cart" properties:trackingAttributes];
  248. }
  249.  
  250. [self dismiss];
  251. diff --git a/buyonetsy/Code/Home/BOEListingCollectionEditableViewController.m b/buyonetsy/Code/Home/BOEListingCollectionEditableViewController.m
  252. index d41058a..525030e 100644
  253. --- a/buyonetsy/Code/Home/BOEListingCollectionEditableViewController.m
  254. +++ b/buyonetsy/Code/Home/BOEListingCollectionEditableViewController.m
  255. @@ -69,7 +69,7 @@ static CGFloat const kListingDeletedHUDMaxWidth = 414.0f;
  256.  
  257. - (void)deleteButtonPressedCell:(EtsyListingCollectionCell *)cell listingId:(id<EtsyObjectID>)listingId {
  258. NSDictionary * attributes = listingId ? @{@"listing_id": listingId} : nil;
  259. - [EtsyAnalytics trackEvent:@"homescreen_editable_collection_listing_deleted" inView:self.analyticsName attributes:attributes];
  260. + [self.analyticsContext logAnalyticsEventNamed:@"homescreen_editable_collection_listing_deleted" properties:attributes];
  261. [self.editableViewDelegate listingDeleted:listingId];
  262. if ([self.editableViewDelegate numberOfListingsRemaining] == 0) {
  263. [self.navigationController popViewControllerAnimated:YES];
  264. @@ -94,7 +94,7 @@ static CGFloat const kListingDeletedHUDMaxWidth = 414.0f;
  265.  
  266. [self.collectionView reloadItemsAtIndexPaths:[self.collectionView indexPathsForVisibleItems]];
  267.  
  268. - [EtsyAnalytics trackEvent:@"homescreen_editable_collection_entered_edit_mode" inView:self.analyticsName];
  269. + [self.analyticsContext logAnalyticsEventNamed:@"homescreen_editable_collection_entered_edit_mode" properties:nil];
  270. }
  271.  
  272. - (UIBarButtonItem*)makeDoneButtonItem {
  273. diff --git a/buyonetsy/Code/Listing/EtsyListingAddToCartButtonsView.m b/buyonetsy/Code/Listing/EtsyListingAddToCartButtonsView.m
  274. index a8e1638..d4d65bd 100644
  275. --- a/buyonetsy/Code/Listing/EtsyListingAddToCartButtonsView.m
  276. +++ b/buyonetsy/Code/Listing/EtsyListingAddToCartButtonsView.m
  277. @@ -669,7 +669,7 @@ typedef NS_ENUM(NSInteger, BOEListingOptionsCompletionIntention) {
  278.  
  279. NSDictionary *analyticsDict = @{@"listing_id": self.listing.listing_id};
  280. if (self.inCart) {
  281. - [EtsyAnalytics trackEvent:@"view_listing" action:@"in_cart_tapped" label:nil value:0 attributes:analyticsDict];
  282. + [self.analyticsContext logAnalyticsEventNamed:@"in_cart_tapped" properties:analyticsDict];
  283.  
  284. [[NSNotificationCenter defaultCenter] postNotificationName:kEtsyNotificationShowListingInCart object:nil
  285. userInfo:@{@"listing_id": self.listing.listing_id, @"listing": self.listing}];
  286. diff --git a/buyonetsy/Code/Listing/EtsyListingFundingButtonsView.m b/buyonetsy/Code/Listing/EtsyListingFundingButtonsView.m
  287. index d200e7a..a889c15 100644
  288. --- a/buyonetsy/Code/Listing/EtsyListingFundingButtonsView.m
  289. +++ b/buyonetsy/Code/Listing/EtsyListingFundingButtonsView.m
  290. @@ -441,7 +441,7 @@ static CGFloat const kEtsyListingPageFundButtonHeight = 51.f;
  291. if (!self.hasSeenPrimaryOptions && self.listing.FundingOptions.count > 1) {
  292. [self showPrimaryOptionsDropDownForButton:self.primaryOptionsBtn options:self.listing.FundingOptions intentToAddToCart:YES];
  293. self.hasSeenPrimaryOptions = YES;
  294. - [EtsyAnalytics trackEvent:@"fund_on_etsy_fund_campaign_options_not_selected" inView:self.analyticsName];
  295. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_fund_campaign_options_not_selected" properties:nil];
  296. return;
  297. }
  298. // Ensure all sub-options are selected
  299. @@ -450,7 +450,7 @@ static CGFloat const kEtsyListingPageFundButtonHeight = 51.f;
  300. if (!obj.selectedOption) {
  301. EtsyLabeledButton *button = self.buttons[idx-1];
  302. [self showSubOptionsDropDownForButton:button options:obj.options intentToAddToCart:YES];
  303. - [EtsyAnalytics trackEvent:@"fund_on_etsy_fund_campaign_options_not_selected" inView:self.analyticsName];
  304. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_fund_campaign_options_not_selected" properties:nil];
  305. *stop = YES;
  306. }
  307. }];
  308. diff --git a/buyonetsy/Code/Listing/EtsyListingTitleView.m b/buyonetsy/Code/Listing/EtsyListingTitleView.m
  309. index 2c68f24..c9e154c 100644
  310. --- a/buyonetsy/Code/Listing/EtsyListingTitleView.m
  311. +++ b/buyonetsy/Code/Listing/EtsyListingTitleView.m
  312. @@ -43,7 +43,7 @@
  313. [UIView animateWithDuration:0.2 animations:^{
  314. [self.label sizeToFit];
  315. }];
  316. - [EtsyAnalytics trackEvent:@"view_listing" action:@"title_expanded" label:nil value:(int)self.label.attributedText.length attributes:@{}];
  317. + [self.analyticsContext logAnalyticsEventNamed:@"title_expanded" properties:@{}];
  318. }
  319.  
  320. -(void)layoutSubviews
  321. diff --git a/buyonetsy/Code/Listing/EtsyListingViewController+FavoritesOnboarding.m b/buyonetsy/Code/Listing/EtsyListingViewController+FavoritesOnboarding.m
  322. index 977f89e..e6c2d29 100644
  323. --- a/buyonetsy/Code/Listing/EtsyListingViewController+FavoritesOnboarding.m
  324. +++ b/buyonetsy/Code/Listing/EtsyListingViewController+FavoritesOnboarding.m
  325. @@ -165,7 +165,8 @@ const CGFloat kEtsyOverlayTooltipFadeInDelay = 0.15; // delay before fade-down a
  326. [self.onboardingOverlay startAnimations];
  327. }];
  328.  
  329. - [EtsyAnalytics trackEvent:@"onboarding_listing_favorite" inView:self.analyticsName];
  330. + [self.analyticsContext logAnalyticsEventNamed:@"onboarding_listing_favorite" properties:nil];
  331. +
  332. [[EtsyGraphite metricWithName:@"onboarding.listing.favorites.show"] increment];
  333. SERVER_LOG_INFO(@"BUYER_ONBOARDING", @"showing listing favorite onboarding:etsy_user_id=\"%@\"",
  334. [[EtsySession localUser].user_id description] ?: @0);
  335. @@ -186,13 +187,13 @@ const CGFloat kEtsyOverlayTooltipFadeInDelay = 0.15; // delay before fade-down a
  336. [self.onboardingOverlay removeFromSuperview];
  337. self.onboardingOverlay = nil;
  338.  
  339. - [EtsyAnalytics trackEvent:@"onboarding_listing_favorite_dismiss" inView:self.analyticsName];
  340. + [self.analyticsContext logAnalyticsEventNamed:@"onboarding_listing_favorite_dismiss" properties:nil];
  341. [[EtsyGraphite metricWithName:@"onboarding.listing.favorites.dismiss"] increment];
  342. }
  343.  
  344. - (void)onboardingViewDidTapButton:(TransparentCutoutView *)cutoutView {
  345. [cutoutView dismissWithCompletion:^{
  346. - [EtsyAnalytics trackEvent:@"onboarding_listing_favorite_tap" inView:self.analyticsName];
  347. + [self.analyticsContext logAnalyticsEventNamed:@"onboarding_listing_favorite_tap" properties:nil];
  348. [[EtsyGraphite metricWithName:@"onboarding.listing.favorites.tap_heart"] increment];
  349.  
  350. [[self toggleManager] toggle:self eventAttributes:@{@"via_favorites_onboarding": @1}];
  351. diff --git a/buyonetsy/Code/Listing/EtsyListingViewController.m b/buyonetsy/Code/Listing/EtsyListingViewController.m
  352. index 9294a79..56f6868 100644
  353. --- a/buyonetsy/Code/Listing/EtsyListingViewController.m
  354. +++ b/buyonetsy/Code/Listing/EtsyListingViewController.m
  355. @@ -625,7 +625,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  356. [listing.fundOnEtsyCampaign unionObjectData:campaign.objectData];
  357. }
  358. [resource.owner displayListing:listing];
  359. - [EtsyAnalytics trackPageview:self.fundingCampaignAnalyticsName];
  360. + [self.analyticsContext logAnalyticsEventNamed:self.fundingCampaignAnalyticsName properties:nil];
  361. } failure:^(EtsyResource *resource, NSError *error) {
  362. // Go ahead and display the listing without this info
  363. [resource.owner displayListing:listing];
  364. @@ -748,16 +748,16 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  365. [photoVC setSafeTransitioningDelegate:self];
  366. [self.screenController presentViewController:photoVC animated:YES completion:nil];
  367.  
  368. - [EtsyAnalytics trackEvent:@"view_listing" action:@"photo_tapped" label:nil value:(int)index attributes:[self createAnalyticsAttributes:nil]];
  369. - [EtsyAnalytics trackPageview:@"listing_image_zoom" attributes:[self createAnalyticsAttributes:nil]];
  370. + [self.analyticsContext logAnalyticsEventNamed:@"photo_tapped" properties:[self createAnalyticsAttributes:nil]];
  371. + [self.analyticsContext logAnalyticsEventNamed:@"listing_image_zoom" properties:[self createAnalyticsAttributes:nil]];
  372.  
  373. }
  374.  
  375. - (void)etsyListingImages:(EtsyListingImagesView *)listingImagesView didScrollToProductImage:(NSUInteger)index
  376. {
  377.  
  378. - [EtsyAnalytics trackEvent:@"view_listing" action:@"listing_image_swipe" label:nil value:0
  379. - attributes:[self createAnalyticsAttributes:@{ @"active_index" : @(index), @"num_images": @(self.numberOfPhotos) }]];
  380. + [self.analyticsContext logAnalyticsEventNamed:@"listing_image_swipe" properties:[self createAnalyticsAttributes:@{ @"active_index" : @(index), @"num_images": @(self.numberOfPhotos) }]];
  381. +
  382. }
  383.  
  384. - (void)etsyListingImagesDidSelectVideo:(id)listingImagesView {
  385. @@ -858,7 +858,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  386.  
  387. - (void)similarListingsView:(BOEListingSimilarListingsView *)view tappedListingCard:(EtsyPublicListingCard *)listingCard
  388. {
  389. - [EtsyAnalytics trackEvent:@"similar_listing_selected" inView:self.defaultAnalyticsName];
  390. + [self.analyticsContext logAnalyticsEventNamed:@"similar_listing_selected" properties:nil];
  391. EtsyListingViewController *listingVC = [[EtsyListingViewController alloc] initWithListingID:listingCard.listing_id];
  392. [self.screenController pushViewController:listingVC];
  393. }
  394. @@ -884,7 +884,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  395. {
  396. if (self.similarListingsScrolled == NO) {
  397. self.similarListingsScrolled = YES;
  398. - [EtsyAnalytics trackEvent:@"similar_listings_scrolled" inView:self.defaultAnalyticsName];
  399. + [self.analyticsContext logAnalyticsEventNamed:@"similar_listings_scrolled" properties:nil];
  400. }
  401. }
  402.  
  403. @@ -892,7 +892,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  404. {
  405. if (self.similarListingsScrolledToEnd == NO) {
  406. self.similarListingsScrolledToEnd = YES;
  407. - [EtsyAnalytics trackEvent:@"similar_listings_scrolled_to_end" inView:self.defaultAnalyticsName];
  408. + [self.analyticsContext logAnalyticsEventNamed:@"similar_listings_scrolled_to_end" properties:nil];
  409. }
  410. }
  411.  
  412. @@ -920,7 +920,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  413. // Display share dialog if already funding
  414. if (isFunding) {
  415. [self didTapShareButton:bannerButton];
  416. - [EtsyAnalytics trackEvent:@"fund_on_etsy_banner_share" inView:self.fundingCampaignAnalyticsName];
  417. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_banner_share" properties:nil];
  418. }
  419. // Otherwise redirect to web landing page
  420. else {
  421. @@ -929,7 +929,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  422. webView.title = @"Fund on Etsy";
  423. webView.shouldDisableInAppURLRedirection = YES;
  424. [self.screenController pushViewController:webView];
  425. - [EtsyAnalytics trackEvent:@"fund_on_etsy_banner_learn_more" inView:self.fundingCampaignAnalyticsName];
  426. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_banner_learn_more" properties:nil];
  427. }
  428. }
  429.  
  430. @@ -1046,13 +1046,13 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  431. - (void)shopInfoFollowCampaignView:(EtsyListingFundingShopInfoFollowCampaignView *)view didTapShopView:(EtsyShop *)shop
  432. {
  433. [self displayShopView:shop];
  434. - [EtsyAnalytics trackEvent:@"fund_on_etsy_view_shop_from_listing" inView:self.fundingCampaignAnalyticsName];
  435. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_view_shop_from_listing" properties:nil];
  436. }
  437.  
  438. - (void)shopInfoFollowCampaignView:(EtsyListingFundingShopInfoFollowCampaignView *)view didTapShopAvatar:(EtsyShop *)shop
  439. {
  440. [self displayShopView:shop];
  441. - [EtsyAnalytics trackEvent:@"fund_on_etsy_view_shop_from_listing" inView:self.fundingCampaignAnalyticsName];
  442. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_view_shop_from_listing" properties:nil];
  443. }
  444.  
  445. #pragma mark EtsyListingPageLatestUpdateViewDelegate
  446. @@ -1068,7 +1068,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  447. {
  448. BOEListingUpdatesViewController *controller = [[BOEListingUpdatesViewController alloc] initWithListingId:self.listing.listing_id];
  449. [self.screenController pushViewController:controller];
  450. - [EtsyAnalytics trackEvent:@"fund_on_etsy_load_more_updates" inView:self.fundingCampaignAnalyticsName];
  451. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_load_more_updates" properties:nil];
  452. }
  453.  
  454. #pragma mark UIViewControllerTransitioningDelegate
  455. @@ -1199,7 +1199,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  456. case MPMoviePlaybackStatePlaying:
  457. if (!self.hasVideoStartedPlaying) {
  458. self.hasVideoStartedPlaying = YES;
  459. - [EtsyAnalytics trackEvent:@"fund_on_etsy_video_play" inView:self.fundingCampaignAnalyticsName];
  460. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_video_play" properties:nil];
  461. }
  462. break;
  463. default:
  464. @@ -1211,11 +1211,11 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  465. NSString *errorMsg;
  466. switch (reason) {
  467. case MPMovieFinishReasonPlaybackEnded:
  468. - [EtsyAnalytics trackEvent:@"fund_on_etsy_video_completed" inView:self.fundingCampaignAnalyticsName];
  469. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_video_completed" properties:nil];
  470. break;
  471. case MPMovieFinishReasonPlaybackError:
  472. errorMsg = error ? [error localizedDescription] : MSG(@"Video playback failed", @"Generic video playback error message", @"");
  473. - [EtsyAnalytics trackEvent:@"fund_on_etsy_video_playback_failure" error:errorMsg];
  474. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_video_playback_failure" properties:nil];
  475. break;
  476. default:
  477. break;
  478. @@ -1263,7 +1263,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  479. storyWebView.title = @"Story";
  480. storyWebView.shouldDisableInAppURLRedirection = YES;
  481. [self.screenController pushViewController:storyWebView];
  482. - [EtsyAnalytics trackEvent:@"fund_on_etsy_read_story" inView:self.fundingCampaignAnalyticsName];
  483. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_read_story" properties:nil];
  484. }
  485.  
  486. - (void)fundingButtonsView:(EtsyListingFundingButtonsView *)view needsOptionsControllerPresented:(EtsyListOptionsViewController *)optionController fromView:(UIView *)sourceView {
  487. @@ -1337,7 +1337,7 @@ typedef NS_ENUM(NSInteger, EtsyListingViewControllerToolbarStyle) {
  488. completion();
  489. }
  490. }];
  491. - [EtsyAnalytics trackEvent:@"fund_on_etsy_fund_campaign" inView:self.fundingCampaignAnalyticsName];
  492. + [self.analyticsContext logAnalyticsEventNamed:@"fund_on_etsy_fund_campaign" properties:nil];
  493. }
  494.  
  495. - (void)runAnalyticsNullTests {
  496. diff --git a/buyonetsy/Code/Local/EtsyLocalBrowseViewController.m b/buyonetsy/Code/Local/EtsyLocalBrowseViewController.m
  497. index b711e35..7f33eb1 100644
  498. --- a/buyonetsy/Code/Local/EtsyLocalBrowseViewController.m
  499. +++ b/buyonetsy/Code/Local/EtsyLocalBrowseViewController.m
  500. @@ -102,7 +102,7 @@ static NSString * const EtsyLocalBrowseAboutLocalModule = @"EtsyLocalBrowseAbout
  501. NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
  502. attributes[@"lat"] = @(location.coordinate.latitude);
  503. attributes[@"lon"] = @(location.coordinate.longitude);
  504. - [EtsyAnalytics trackEvent:@"location_obtained" inView:self.container.analyticsName attributes:attributes];
  505. + [self.analyticsContext logAnalyticsEventNamed:@"location_obtained" properties:attributes];
  506.  
  507. [self updateResource];
  508. self.shouldReloadResource = NO;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement