diff --git a/WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift b/WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift index 6dc775a463d6..091202eaf25f 100644 --- a/WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift +++ b/WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift @@ -594,6 +594,11 @@ import Foundation case readingPreferencesSaved case readingPreferencesClosed + // Stats Subscribers + case statsSubscribersViewMoreTapped + case statsEmailsViewMoreTapped + case statsSubscribersChartTapped + /// A String that represents the event var value: String { switch self { @@ -1615,6 +1620,14 @@ import Foundation case .readingPreferencesClosed: return "reader_reading_preferences_closed" + // Stats Subscribers + case .statsSubscribersViewMoreTapped: + return "stats_subscribers_view_more_tapped" + case .statsEmailsViewMoreTapped: + return "stats_emails_view_more_tapped" + case .statsSubscribersChartTapped: + return "stats_subscribers_chart_tapped" + } // END OF SWITCH } diff --git a/WordPress/Classes/ViewRelated/Stats/Charts/StatsLineChartView.swift b/WordPress/Classes/ViewRelated/Stats/Charts/StatsLineChartView.swift index 9ba554bd8da0..10a8ddbeb5a8 100644 --- a/WordPress/Classes/ViewRelated/Stats/Charts/StatsLineChartView.swift +++ b/WordPress/Classes/ViewRelated/Stats/Charts/StatsLineChartView.swift @@ -115,9 +115,10 @@ private extension StatsLineChartView { if case let .viewsAndVisitors(statsInsightsFilterDimension) = statType { properties[LineChartAnalyticsPropertyKey] = statsInsightsFilterDimension.analyticsProperty + WPAnalytics.track(.statsLineChartTapped, properties: properties) + } else if case .subscribers = statType { + WPAnalytics.track(.statsSubscribersChartTapped) } - - WPAnalytics.track(.statsLineChartTapped, properties: properties) } func configureAndPopulateData() { diff --git a/WordPress/Classes/ViewRelated/Stats/Subscribers/StatsSubscribersViewController.swift b/WordPress/Classes/ViewRelated/Stats/Subscribers/StatsSubscribersViewController.swift index 2df49148e7dd..34d8d2e28edc 100644 --- a/WordPress/Classes/ViewRelated/Stats/Subscribers/StatsSubscribersViewController.swift +++ b/WordPress/Classes/ViewRelated/Stats/Subscribers/StatsSubscribersViewController.swift @@ -85,13 +85,14 @@ extension StatsSubscribersViewController: SiteStatsPeriodDelegate { guard let blog = RootViewCoordinator.sharedPresenter.mySitesCoordinator.currentBlog, let peopleViewController = PeopleViewController.controllerWithBlog(blog, selectedFilter: .followers) else { return } navigationController?.pushViewController(peopleViewController, animated: true) + WPAnalytics.track(.statsSubscribersViewMoreTapped) case .subscribersEmailsSummary: let detailTableViewController = SiteStatsDetailTableViewController.loadFromStoryboard() detailTableViewController.configure(statSection: statSection) navigationController?.pushViewController(detailTableViewController, animated: true) + WPAnalytics.track(.statsEmailsViewMoreTapped) default: - // TODO - DDLogInfo("\(statSection) selected") + break } } }