Skip to content

Commit

Permalink
Stats Subscribers Analytics (#23151)
Browse files Browse the repository at this point in the history
  • Loading branch information
staskus authored May 6, 2024
2 parents e187759 + 1ce2eb8 commit 58a864e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
13 changes: 13 additions & 0 deletions WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

0 comments on commit 58a864e

Please sign in to comment.