Browse Source

【用户挽回】埋点补充

tangchao 5 months ago
parent
commit
66d8e721a9

+ 19 - 0
PDF Office/PDF Master/Class/Purchase/Appstore/KMPurchaseCompareWindowController.m

@@ -1066,6 +1066,15 @@ static NSString *const KMPurchaseCompareCellIdentifier       = @"KMPurchaseCompa
     }
     [self addWaingView:self.window.contentView];
     [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_Upgrade_6Mon"}];
+
+    if ([self isShowSale]) {
+        self.kEventTag = 1;
+        if (self.isPurchaseSwitch) {
+            [self trackEvent_freeWithEventName:@"PromotionalOffer" params:@{@"PUW_Btn" : @"PUW_7OffUpgrade_12Mon"} platform:KMAnalyticsPlatformAppCenter];
+        } else {
+            [self trackEvent_freeWithEventName:@"PromotionalOffer" params:@{@"PUW_Btn" : @"PUW_7OffUpgrade_6Mon"} platform:KMAnalyticsPlatformAppCenter];
+        }
+    }
 }
 
 - (void)showDiscountToSaveWindow {
@@ -1308,6 +1317,16 @@ static NSString *const KMPurchaseCompareCellIdentifier       = @"KMPurchaseCompa
 - (void)IAPProductPurchasedNotification:(NSNotification*)notification {
     [self removeWaitingView:self.window.contentView];
     [self reloadData];
+    
+    if (IAPProductsManager.defaultManager.newlyMonthProduct.isSubscribed) {
+        if (self.kEventTag == 1) {
+            [self trackEvent_freeWithEventName:@"PromotionalOffer" params:@{@"PUW_Btn" : @"PUW_7OffUpgrade_6MonthPaid"} platform:KMAnalyticsPlatformAppCenter];
+        }
+    } else if (IAPProductsManager.defaultManager.yearProduct.isSubscribed) {
+        if (self.kEventTag == 1) {
+            [self trackEvent_freeWithEventName:@"PromotionalOffer" params:@{@"PUW_Btn" : @"PUW_7OffUpgrade_12MonthPaid"} platform:KMAnalyticsPlatformAppCenter];
+        }
+    }
 }
 
 - (void)IAPProductLoadedNotification:(NSNotification*)notification {