diff --git a/iphone/Maps/Bookmarks/Catalog/CatalogWebViewController.swift b/iphone/Maps/Bookmarks/Catalog/CatalogWebViewController.swift index 9d481ea2d2..f753da6e2f 100644 --- a/iphone/Maps/Bookmarks/Catalog/CatalogWebViewController.swift +++ b/iphone/Maps/Bookmarks/Catalog/CatalogWebViewController.swift @@ -381,7 +381,8 @@ final class CatalogWebViewController: WebViewController { let testGroup = PromoCampaignManager.manager().paidRoutesSubscriptionCampaign.testGroupStatName let stats = InAppPurchase.paidRouteStatistics(serverId: productInfo.id, productId: productId, - testGroup: testGroup) + testGroup: testGroup, + source: kStatWebView) let paymentVC = PaidRouteViewController(name: productInfo.name, author: productInfo.author, imageUrl: URL(string: productInfo.imageUrl ?? ""), diff --git a/iphone/Maps/Bookmarks/Catalog/Subscription/AllPassSubscriptionViewController.swift b/iphone/Maps/Bookmarks/Catalog/Subscription/AllPassSubscriptionViewController.swift index 4cc4fecd63..62d5472c23 100644 --- a/iphone/Maps/Bookmarks/Catalog/Subscription/AllPassSubscriptionViewController.swift +++ b/iphone/Maps/Bookmarks/Catalog/Subscription/AllPassSubscriptionViewController.swift @@ -74,11 +74,6 @@ class AllPassSubscriptionViewController: BaseSubscriptionViewController { .year: annualDiscountLabel]) self.preferredContentSize = CGSize(width: 414, height: contentView.frame.height) - - Statistics.logEvent(kStatInappShow, withParameters: [kStatVendor: MWMPurchaseManager.allPassProductIds, - kStatPurchase: MWMPurchaseManager.allPassSubscriptionServerId(), - kStatProduct: MWMPurchaseManager.allPassProductIds()[0], - kStatFrom: source], with: .realtime) } @IBAction func onAnnualButtonTap(_ sender: UIButton) { diff --git a/iphone/Maps/Bookmarks/Catalog/Subscription/BaseSubscriptionViewController.swift b/iphone/Maps/Bookmarks/Catalog/Subscription/BaseSubscriptionViewController.swift index 76ea6d4b91..dba1341a06 100644 --- a/iphone/Maps/Bookmarks/Catalog/Subscription/BaseSubscriptionViewController.swift +++ b/iphone/Maps/Bookmarks/Catalog/Subscription/BaseSubscriptionViewController.swift @@ -98,6 +98,9 @@ class BaseSubscriptionViewController: MWMViewController { self?.subscriptionManager?.subscribe(to: subscription) } } + Statistics.logEvent(kStatInappSelect, withParameters: [kStatPurchase: subscriptionManager?.serverId ?? "", + kStatProduct: subscription.productId], + with: .realtime) Statistics.logEvent(kStatInappPay, withParameters: [kStatPurchase: subscriptionManager?.serverId ?? ""], with: .realtime) } diff --git a/iphone/Maps/Core/InappPurchase/Impl/PaidRouteStatistics.swift b/iphone/Maps/Core/InappPurchase/Impl/PaidRouteStatistics.swift index 240f13e63c..0315568590 100644 --- a/iphone/Maps/Core/InappPurchase/Impl/PaidRouteStatistics.swift +++ b/iphone/Maps/Core/InappPurchase/Impl/PaidRouteStatistics.swift @@ -3,15 +3,18 @@ class PaidRouteStatistics: IPaidRouteStatistics { let productId: String let vendor: String let testGroup: String + let source: String init(serverId: String, productId: String, vendor: String, - testGroup: String) { + testGroup: String, + source: String) { self.serverId = serverId self.productId = productId self.vendor = vendor self.testGroup = testGroup + self.source = source } func logPreviewShow() { diff --git a/iphone/Maps/Core/InappPurchase/InAppPurchase.swift b/iphone/Maps/Core/InappPurchase/InAppPurchase.swift index a6b4db62a2..2950c7efe3 100644 --- a/iphone/Maps/Core/InappPurchase/InAppPurchase.swift +++ b/iphone/Maps/Core/InappPurchase/InAppPurchase.swift @@ -13,8 +13,13 @@ final class InAppPurchase: NSObject { static func paidRouteStatistics(serverId: String, productId: String, - testGroup: String) -> IPaidRouteStatistics { - return PaidRouteStatistics(serverId: serverId, productId: productId, vendor: BOOKMARKS_VENDOR, testGroup: testGroup) + testGroup: String, + source: String) -> IPaidRouteStatistics { + return PaidRouteStatistics(serverId: serverId, + productId: productId, + vendor: BOOKMARKS_VENDOR, + testGroup: testGroup, + source: source) } @objc