Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader Comments: Track when notification setting is toggled #17369

Merged
merged 2 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions WordPress/Classes/Services/FollowCommentsService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ class FollowCommentsService: NSObject {
ContextManager.sharedInstance().saveContextAndWait(self.context)
success()

WPAnalytics.trackReader(.readerToggleCommentNotifications,
properties: [WPAppAnalyticsKeyBlogID: self.siteID, AnalyticsKeys.enabled: isNotificationsEnabled])

dvdchr marked this conversation as resolved.
Show resolved Hide resolved
} failure: { error in
DDLogError("Error updating notification settings for followed conversation: \(String(describing: error))")
failure(error)
Expand All @@ -123,4 +126,8 @@ class FollowCommentsService: NSObject {
case followed
case unfollowed
}

private struct AnalyticsKeys {
static let enabled = "notifications_enabled"
}
}
3 changes: 3 additions & 0 deletions WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import Foundation
case readerBlogBlocked
case readerChipsMoreToggled
case readerToggleFollowConversation
case readerToggleCommentNotifications
case readerPostReported
case readerArticleDetailMoreTapped
case readerSharedItem
Expand Down Expand Up @@ -325,6 +326,8 @@ import Foundation
return "reader_chips_more_toggled"
case .readerToggleFollowConversation:
return "reader_toggle_follow_conversation"
case .readerToggleCommentNotifications:
return "reader_toggle_comment_notifications"
case .readerPostReported:
return "reader_post_reported"
case .readerArticleDetailMoreTapped:
Expand Down