Skip to content

Commit

Permalink
Add tracking for comment sharing intent
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdchr committed Dec 9, 2021
1 parent bd211eb commit 7be9e2d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ import Foundation
case sharingButtonsEditMoreButtonToggled
case sharingButtonsLabelChanged

// Comment Sharing
case readerArticleCommentShared
case siteCommentsCommentShared

// People
case peopleFilterChanged
case peopleUserInvited
Expand Down Expand Up @@ -756,6 +760,12 @@ import Foundation
case .sharingButtonsLabelChanged:
return "sharing_buttons_label_changed"

// Comment Sharing
case .readerArticleCommentShared:
return "reader_article_comment_shared"
case .siteCommentsCommentShared:
return "site_comments_comment_shared"

// People
case .peopleFilterChanged:
return "people_management_filter_changed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ private extension CommentDetailViewController {
return
}

// track share intent.
WPAnalytics.track(.siteCommentsCommentShared)

let activityViewController = UIActivityViewController(activityItems: [commentURL as Any], applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = senderView
present(activityViewController, animated: true, completion: nil)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import UIKit
import WordPressShared

@objc public extension ReaderCommentsViewController {
func shouldShowSuggestions(for siteID: NSNumber?) -> Bool {
Expand Down Expand Up @@ -104,6 +105,9 @@ import UIKit
return
}

// track share intent.
WPAnalytics.track(.readerArticleCommentShared)

let activityViewController = UIActivityViewController(activityItems: [commentURL as Any], applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = sourceView
present(activityViewController, animated: true, completion: nil)
Expand Down

0 comments on commit 7be9e2d

Please sign in to comment.