diff --git a/WordPress/Classes/Services/FollowCommentsService.swift b/WordPress/Classes/Services/FollowCommentsService.swift index 84bf0b48ded0..165e3c0e1c16 100644 --- a/WordPress/Classes/Services/FollowCommentsService.swift +++ b/WordPress/Classes/Services/FollowCommentsService.swift @@ -103,6 +103,9 @@ class FollowCommentsService: NSObject { @objc func toggleNotificationSettings(_ isNotificationsEnabled: Bool, success: @escaping () -> Void, failure: @escaping (Error?) -> Void) { + WPAnalytics.trackReader(.readerToggleCommentNotifications, + properties: [WPAppAnalyticsKeyBlogID: self.siteID, AnalyticsKeys.enabled: isNotificationsEnabled]) + remote.updateNotificationSettingsForPost(with: postID, siteID: siteID, receiveNotifications: isNotificationsEnabled) { [weak self] in guard let self = self else { failure(nil) @@ -123,4 +126,8 @@ class FollowCommentsService: NSObject { case followed case unfollowed } + + private struct AnalyticsKeys { + static let enabled = "notifications_enabled" + } } diff --git a/WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift b/WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift index c0c97470f2e8..a453bbddbe6a 100644 --- a/WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift +++ b/WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift @@ -78,6 +78,7 @@ import Foundation case readerBlogBlocked case readerChipsMoreToggled case readerToggleFollowConversation + case readerToggleCommentNotifications case readerPostReported case readerArticleDetailMoreTapped case readerSharedItem @@ -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: