[Follow] Record histogram when Follow Recommendation IPH is shown
Follow Recommendation IPH is the textual bubble pops up
from bottom toolbar when the user is browsing an applicable
website. It tells the user that they can follow the site
through 3-dot menu item.
Record histogram when follow Recommendation IPH is shown.
Bug: 1334801
Change-Id: I47f48b6c73d7e683d6dc29e9da965e451fce9fef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3696902
Reviewed-by: edchin <edchin@google.com>
Reviewed-by: Cathy Li <chili@chromium.org>
Reviewed-by: Adam Arcaro <adamta@google.com>
Commit-Queue: Tina Wang <tinazwang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1012658}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
973eba654f
commit
789775b4d5
components/feed/core/v2
ios/chrome/browser/ui
tools/metrics/histograms
@ -590,6 +590,7 @@ void MetricsReporter::OtherUserAction(const StreamType& stream_type,
|
||||
case FeedUserActionType::kFirstFollowSheetShown:
|
||||
case FeedUserActionType::kFirstFollowSheetTappedGoToFeed:
|
||||
case FeedUserActionType::kFirstFollowSheetTappedGotIt:
|
||||
case FeedUserActionType::kFollowRecommendationIPHShown:
|
||||
// Nothing additional for these actions. Note that some of these are iOS
|
||||
// only.
|
||||
|
||||
|
@ -124,6 +124,8 @@ std::ostream& operator<<(std::ostream& out, FeedUserActionType value) {
|
||||
return out << "kFirstFollowSheetTappedGoToFeed";
|
||||
case FeedUserActionType::kFirstFollowSheetTappedGotIt:
|
||||
return out << "kFirstFollowSheetTappedGotIt";
|
||||
case FeedUserActionType::kFollowRecommendationIPHShown:
|
||||
return out << "kFollowRecommendationIPHShown";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,8 +155,11 @@ enum class FeedUserActionType {
|
||||
kFirstFollowSheetTappedGoToFeed = 55,
|
||||
// User tapped the "Got It" button on the first follow sheet. (IOS)
|
||||
kFirstFollowSheetTappedGotIt = 56,
|
||||
// Page load caused a Follow Recommendation IPH to be shown. User action not
|
||||
// reported here. iOS only.
|
||||
kFollowRecommendationIPHShown = 57,
|
||||
|
||||
kMaxValue = kFirstFollowSheetTappedGotIt,
|
||||
kMaxValue = kFollowRecommendationIPHShown,
|
||||
};
|
||||
|
||||
// For testing and debugging only.
|
||||
|
@ -24,10 +24,13 @@ source_set("follow_iph") {
|
||||
"follow_iph_coordinator.mm",
|
||||
]
|
||||
deps = [
|
||||
"//ios/chrome/browser/discover_feed",
|
||||
"//ios/chrome/browser/discover_feed:discover_feed_factory",
|
||||
"//ios/chrome/browser/follow:tab_helper",
|
||||
"//ios/chrome/browser/main:public",
|
||||
"//ios/chrome/browser/ui/commands",
|
||||
"//ios/chrome/browser/ui/coordinators:chrome_coordinators",
|
||||
"//ios/chrome/browser/ui/ntp:metrics",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -4,9 +4,12 @@
|
||||
|
||||
#import "ios/chrome/browser/ui/follow/follow_iph_coordinator.h"
|
||||
|
||||
#include "ios/chrome/browser/discover_feed/discover_feed_service.h"
|
||||
#include "ios/chrome/browser/discover_feed/discover_feed_service_factory.h"
|
||||
#import "ios/chrome/browser/main/browser.h"
|
||||
#import "ios/chrome/browser/ui/commands/browser_commands.h"
|
||||
#import "ios/chrome/browser/ui/commands/command_dispatcher.h"
|
||||
#import "ios/chrome/browser/ui/ntp/feed_metrics_recorder.h"
|
||||
|
||||
#if !defined(__has_feature) || !__has_feature(objc_arc)
|
||||
#error "This file requires ARC support."
|
||||
@ -20,6 +23,11 @@
|
||||
id<BrowserCommands> browserCommandsHandler =
|
||||
static_cast<id<BrowserCommands>>(self.browser->GetCommandDispatcher());
|
||||
[browserCommandsHandler showFollowWhileBrowsingIPH];
|
||||
FeedMetricsRecorder* feedMetricsRecorder =
|
||||
DiscoverFeedServiceFactory::GetForBrowserState(
|
||||
self.browser->GetBrowserState())
|
||||
->GetFeedMetricsRecorder();
|
||||
[feedMetricsRecorder recordFollowRecommendationIPHShown];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -278,6 +278,11 @@ class Time;
|
||||
// Record metrics for when the user taps "Got it" on the first follow sheet.
|
||||
- (void)recordFirstFollowTappedGotIt;
|
||||
|
||||
// Record metrics for when a Follow Recommendation IPH is shown.
|
||||
// A follow Recommendation IPH is a textual bublle that tells users that they
|
||||
// are able to follow a website.
|
||||
- (void)recordFollowRecommendationIPHShown;
|
||||
|
||||
// Delegate to get the currently selected feed.
|
||||
@property(nonatomic, weak) id<FeedControlDelegate> feedControlDelegate;
|
||||
|
||||
|
@ -818,6 +818,11 @@ constexpr base::TimeDelta kUserSettingsMaxAge = base::Days(14);
|
||||
base::RecordAction(base::UserMetricsAction(kFirstFollowGotItButtonTapped));
|
||||
}
|
||||
|
||||
- (void)recordFollowRecommendationIPHShown {
|
||||
[self recordDiscoverFeedUserActionHistogram:
|
||||
FeedUserActionType::kFollowRecommendationIPHShown];
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
// Returns the UserSettingsOnStart value based on the user settings.
|
||||
|
@ -40813,19 +40813,22 @@ Called by update_permissions_policy_enum.py.-->
|
||||
label="User selected the Following feed from the feed header."/>
|
||||
<int value="47"
|
||||
label="User tapped the Unfollow button on the page overflow menu."/>
|
||||
<int value="48" label="Show Follow Succeed Snackbar"/>
|
||||
<int value="49" label="Show Follow Failed Snackbar"/>
|
||||
<int value="50" label="Show Unfollow Succeed Snackbar"/>
|
||||
<int value="51" label="Show Unfollow Failed Snackbar"/>
|
||||
<int value="48" label="Show Follow Succeed Snackbar."/>
|
||||
<int value="49" label="Show Follow Failed Snackbar."/>
|
||||
<int value="50" label="Show Unfollow Succeed Snackbar."/>
|
||||
<int value="51" label="Show Unfollow Failed Snackbar."/>
|
||||
<int value="52"
|
||||
label="User tapped to go to feed using the snackbar 'go to feed'
|
||||
option."/>
|
||||
<int value="53" label="User tapped the Crow button in the context menu"/>
|
||||
<int value="54" label="Show First Follow Sheet"/>
|
||||
<int value="53" label="User tapped the Crow button in the context menu."/>
|
||||
<int value="54" label="Show First Follow Sheet."/>
|
||||
<int value="55"
|
||||
label="User tapped the 'Go To Feed' button on the first follow sheet."/>
|
||||
<int value="56"
|
||||
label="User tapped the 'Got It' button on the first follow sheet."/>
|
||||
<int value="57"
|
||||
label="Show Follow Recommendation IPH telling users that they are able
|
||||
to follow a website."/>
|
||||
</enum>
|
||||
|
||||
<enum name="FeedUserCommandType">
|
||||
|
Reference in New Issue
Block a user