Commit f5479bbc authored by Renato Silva's avatar Renato Silva Committed by Commit Bot

OOBE - Marketing - Combine marketing metrics

Generate an additional metric that combines data from
all countries for the Chromebook marketing opt-in.

Fixed: 1136816
Change-Id: I521824b2b5f7d5c06402dad5ccbe1719dd1c197d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463613
Commit-Queue: Renato Silva <rrsilva@google.com>
Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
Auto-Submit: Renato Silva <rrsilva@google.com>
Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816168}
parent db5b3088
......@@ -54,6 +54,10 @@ void RecordUMAHistogram(MarketingBackendConnector::BackendConnectorEvent event,
const std::string& country) {
base::UmaHistogramEnumeration(
"OOBE.MarketingOptInScreen.BackendConnector." + country, event);
// Generic event aggregating data from all countries.
base::UmaHistogramEnumeration("OOBE.MarketingOptInScreen.BackendConnector",
event);
}
std::unique_ptr<network::ResourceRequest> GetResourceRequest() {
......
......@@ -58,6 +58,8 @@ void RecordOptInAndOptOutRates(const bool user_opted_in,
base::UmaHistogramEnumeration("OOBE.MarketingOptInScreen.Event." + country,
event);
// Generic event aggregating data from all countries.
base::UmaHistogramEnumeration("OOBE.MarketingOptInScreen.Event", event);
}
void RecordGeolocationResolve(MarketingOptInScreen::GeolocationEvent event) {
......
......@@ -408,12 +408,16 @@ IN_PROC_BROWSER_TEST_P(MarketingTestCountryCodes, CountryCodes) {
TapOnGetStartedAndWaitForScreenExit();
WaitForBackendRequest();
EXPECT_EQ(GetRequestedCountryCode(), param.country_code);
histogram_tester_.ExpectUniqueSample(
"OOBE.MarketingOptInScreen.Event." + std::string(param.country_code),
const auto event =
(param.is_default_opt_in)
? MarketingOptInScreen::Event::kUserOptedInWhenDefaultIsOptIn
: MarketingOptInScreen::Event::kUserOptedInWhenDefaultIsOptOut,
1);
: MarketingOptInScreen::Event::kUserOptedInWhenDefaultIsOptOut;
histogram_tester_.ExpectUniqueSample(
"OOBE.MarketingOptInScreen.Event." + std::string(param.country_code),
event, 1);
// Expect a generic event in addition to the country specific one.
histogram_tester_.ExpectUniqueSample("OOBE.MarketingOptInScreen.Event", event,
1);
// Expect successful geolocation resolve.
ExpectGeolocationMetric(true, std::string(param.country_code).size());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment