diff --git a/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListFragmentPage.kt b/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListFragmentPage.kt index c57413e1eebc..149f4308e306 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListFragmentPage.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListFragmentPage.kt @@ -26,6 +26,7 @@ import org.wordpress.android.BuildConfig import org.wordpress.android.R import org.wordpress.android.WordPress import org.wordpress.android.analytics.AnalyticsTracker.Stat.APP_REVIEWS_EVENT_INCREMENTED_BY_CHECKING_NOTIFICATION +import org.wordpress.android.analytics.AnalyticsTracker.Stat.NOTIFICATIONS_INLINE_ACTION_TAPPED import org.wordpress.android.databinding.NotificationsListFragmentPageBinding import org.wordpress.android.datasets.NotificationsTable import org.wordpress.android.fluxc.model.CommentStatus @@ -62,6 +63,7 @@ import org.wordpress.android.util.AppLog.T import org.wordpress.android.util.DisplayUtils import org.wordpress.android.util.NetworkUtils import org.wordpress.android.util.WPSwipeToRefreshHelper +import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper import org.wordpress.android.util.helpers.SwipeToRefreshHelper import org.wordpress.android.widgets.AppRatingDialog.incrementInteractions import javax.inject.Inject @@ -83,6 +85,9 @@ class NotificationsListFragmentPage : ViewPagerFragment(R.layout.notifications_l @Inject lateinit var gcmMessageHandler: GCMMessageHandler + @Inject + lateinit var analyticsTrackerWrapper: AnalyticsTrackerWrapper + private val showNewUnseenNotificationsRunnable = Runnable { if (isAdded) { binding?.notificationsList?.addOnScrollListener(mOnScrollListener) @@ -410,6 +415,9 @@ class NotificationsListFragmentPage : ViewPagerFragment(R.layout.notifications_l } private fun handleInlineActionEvent(actionEvent: InlineActionEvent) { + analyticsTrackerWrapper.track(NOTIFICATIONS_INLINE_ACTION_TAPPED, mapOf( + InlineActionEvent.KEY_INLINE_ACTION to actionEvent::class.simpleName + )) when (actionEvent) { is SharePostButtonTapped -> actionEvent.notification.let { postNotification -> context?.let { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListViewModel.kt index 2307deba635e..52c3f4f6ef39 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListViewModel.kt @@ -94,5 +94,9 @@ class NotificationsListViewModel @Inject constructor( sealed class InlineActionEvent { data class SharePostButtonTapped(val notification: PostNotification) : InlineActionEvent() class LikeCommentButtonTapped(val note: Note, val liked: Boolean) : InlineActionEvent() + + companion object { + const val KEY_INLINE_ACTION = "inline_action" + } } } diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java index 1ff40457f641..550a8ce13999 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java @@ -1109,6 +1109,7 @@ public enum Stat { SITE_MONITORING_TAB_LOADING_ERROR, NOTIFICATION_MENU_TAPPED, NOTIFICATIONS_MARK_ALL_READ_TAPPED, + NOTIFICATIONS_INLINE_ACTION_TAPPED, WEBVIEW_TOO_LARGE_PAYLOAD_ERROR, } diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java index 540c90c0afa4..5a0198466930 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java @@ -2711,6 +2711,8 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) { return "notification_menu_tapped"; case NOTIFICATIONS_MARK_ALL_READ_TAPPED: return "notifications_mark_all_read_tapped"; + case NOTIFICATIONS_INLINE_ACTION_TAPPED: + return "notifications_inline_action_tapped"; case WEBVIEW_TOO_LARGE_PAYLOAD_ERROR: return "webview_too_large_payload_error"; }