diff --git a/ios/chrome/browser/ui/ntp/metrics/feed_metrics_constants.h b/ios/chrome/browser/ui/ntp/metrics/feed_metrics_constants.h index 4706108be26c7..436290bb32257 100644 --- a/ios/chrome/browser/ui/ntp/metrics/feed_metrics_constants.h +++ b/ios/chrome/browser/ui/ntp/metrics/feed_metrics_constants.h @@ -193,12 +193,6 @@ extern const char kDiscoverFeedCardShownAtIndex[]; // Histogram name for a Following feed card shown at index. extern const char kFollowingFeedCardShownAtIndex[]; -// Histogram name for a Discover feed card tapped at index. -extern const char kDiscoverFeedCardOpenedAtIndex[]; - -// Histogram name for a Following feed card tapped at index. -extern const char kFollowingFeedCardOpenedAtIndex[]; - // Histogram name to capture Feed Notice card impressions. extern const char kDiscoverFeedNoticeCardFulfilled[]; @@ -230,10 +224,12 @@ extern const char kDiscoverFeedUploadActionsNetworkDurationFailure[]; // operation. extern const char kDiscoverFeedNetworkDuration[]; -// Histogram name to measure opened URL's regardless of the surface they were -// opened in. +// Histogram name to track opened articles from the Discover feed. extern const char kDiscoverFeedURLOpened[]; +// Histogram name to track opened articles from the Following feed. +extern const char kFollowingFeedURLOpened[]; + // Histogram name to capture if the last Feed fetch had logging enabled. extern const char kDiscoverFeedActivityLoggingEnabled[]; diff --git a/ios/chrome/browser/ui/ntp/metrics/feed_metrics_constants.mm b/ios/chrome/browser/ui/ntp/metrics/feed_metrics_constants.mm index ac8f21fb96db5..6190dd56756cb 100644 --- a/ios/chrome/browser/ui/ntp/metrics/feed_metrics_constants.mm +++ b/ios/chrome/browser/ui/ntp/metrics/feed_metrics_constants.mm @@ -34,10 +34,6 @@ "NewTabPage.ContentSuggestions.Shown"; const char kFollowingFeedCardShownAtIndex[] = "ContentSuggestions.Feed.WebFeed.Shown"; -const char kDiscoverFeedCardOpenedAtIndex[] = - "NewTabPage.ContentSuggestions.Opened"; -const char kFollowingFeedCardOpenedAtIndex[] = - "ContentSuggestions.Feed.WebFeed.Opened"; const char kDiscoverFeedNoticeCardFulfilled[] = "ContentSuggestions.Feed.NoticeCardFulfilled2"; const char kDiscoverFeedArticlesFetchNetworkDurationSuccess[] = @@ -55,6 +51,7 @@ const char kDiscoverFeedNetworkDuration[] = "ContentSuggestions.Feed.Network.Duration"; const char kDiscoverFeedURLOpened[] = "NewTabPage.ContentSuggestions.Opened"; +const char kFollowingFeedURLOpened[] = "ContentSuggestions.Feed.WebFeed.Opened"; const char kDiscoverFeedActivityLoggingEnabled[] = "ContentSuggestions.Feed.ActivityLoggingEnabled"; const char kDiscoverFeedBrokenNTPHierarchy[] = diff --git a/ios/chrome/browser/ui/ntp/metrics/feed_metrics_recorder.mm b/ios/chrome/browser/ui/ntp/metrics/feed_metrics_recorder.mm index a26736d476f53..41b5f1dbbdbfe 100644 --- a/ios/chrome/browser/ui/ntp/metrics/feed_metrics_recorder.mm +++ b/ios/chrome/browser/ui/ntp/metrics/feed_metrics_recorder.mm @@ -343,15 +343,8 @@ - (void)recordCardShownAtIndex:(int)index { } - (void)recordCardTappedAtIndex:(int)index { - switch ([self.feedControlDelegate selectedFeed]) { - case FeedTypeDiscover: - UMA_HISTOGRAM_EXACT_LINEAR(kDiscoverFeedCardOpenedAtIndex, index, - kMaxCardsInFeed); - break; - case FeedTypeFollowing: - UMA_HISTOGRAM_EXACT_LINEAR(kFollowingFeedCardOpenedAtIndex, index, - kMaxCardsInFeed); - } + // TODO(crbug.com/1174088): No-op since this function gets called multiple + // times for a tap. Log index when this is fixed. } - (void)recordNoticeCardShown:(BOOL)shown { @@ -997,8 +990,13 @@ - (void)recordOpenURL { IOSContentSuggestionsActionType::kFeedCard); } - // TODO(crbug.com/1174088): Add card Index and the max number of suggestions. - UMA_HISTOGRAM_EXACT_LINEAR(kDiscoverFeedURLOpened, 0, 1); + switch ([self.feedControlDelegate selectedFeed]) { + case FeedTypeDiscover: + UMA_HISTOGRAM_EXACT_LINEAR(kDiscoverFeedURLOpened, 0, 1); + break; + case FeedTypeFollowing: + UMA_HISTOGRAM_EXACT_LINEAR(kFollowingFeedURLOpened, 0, 1); + } } #pragma mark - Converters