Skip to content

Commit

Permalink
Add analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Jan 7, 2025
1 parent 8e0026c commit 6ead7b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ import Foundation
case readerCommentTextCopied
case readerPostContextMenuButtonTapped
case readerAddSiteToFavoritesTapped
case readerButtonScrollToTopTapped

// Stats - Empty Stats nudges
case statsPublicizeNudgeShown
Expand Down Expand Up @@ -816,6 +817,8 @@ import Foundation
return "reader_post_context_menu_button_tapped"
case .readerAddSiteToFavoritesTapped:
return "reader_add_site_to_favorites_tapped"
case .readerButtonScrollToTopTapped:
return "reader_button_scroll_to_top_tapped"

// Stats - Empty Stats nudges
case .statsPublicizeNudgeShown:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ extension ReaderStreamViewController: UITableViewDelegate, JPScrollViewDelegate
layoutEmptyStateView()
processJetpackBannerVisibility(scrollView)
titleView.updateAlpha(in: scrollView)
buttonScrollToTop.setButtonHidden(scrollView.contentOffset.y < bounds.height / 3, animated: true)
buttonScrollToTop.setButtonHidden(scrollView.contentOffset.y < view.bounds.height / 3, animated: true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ final class ReaderButtonScrollToTop: UIButton {

return ReaderButtonScrollToTop(configuration: configuration, primaryAction: .init { _ in
closure()
WPAnalytics.track(.readerButtonScrollToTopTapped)
})
}

Expand Down

0 comments on commit 6ead7b3

Please sign in to comment.