Skip to content

Commit

Permalink
[PIX] Metrics cleanup - Phase 2
Browse files Browse the repository at this point in the history
Deprecate PaymentNotOfferedReason and FopSelector.Shown UMA metrics.
go/pix-in-chrome-metrics-revised

OBSOLETE_HISTOGRAM[FacilitatedPayments.Pix.FopSelector.Shown]=Deprecated
OBSOLETE_HISTOGRAM[FacilitatedPayments.Pix.PaymentNotOfferedReason]=Deprecated

Bug: 377126728, 367751320
Change-Id: If0b6157640d767e2c243ab576cc4fe33fff8e101
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050703
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Siyu An <siyua@chromium.org>
Commit-Queue: Vishwas Uppoor <vishwasuppoor@google.com>
Cr-Commit-Position: refs/heads/main@{#1391265}
  • Loading branch information
Vishwas Uppoor authored and pull[bot] committed Dec 5, 2024
1 parent 3877a57 commit 55561f5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ void LogPayflowExitedReason(PayflowExitedReason reason) {
reason);
}

// TODO(crbug.com/367751320): Remove after new PayflowExitedReason histogram is
// finished.
void LogPaymentNotOfferedReason(PaymentNotOfferedReason reason) {
base::UmaHistogramEnumeration(
"FacilitatedPayments.Pix.PaymentNotOfferedReason", reason);
}

void LogInitiatePaymentAttempt() {
// TODO(crbug.com/337929926): Remove hardcoding for Pix and use
// FacilitatedPaymentsType enum.
Expand Down Expand Up @@ -156,12 +149,6 @@ uint8_t ConvertPurchaseActionResultToEnumValue(const std::string& result) {
}
}

void LogFopSelectorShown(bool shown) {
// TODO(crbug.com/337929926): Remove hardcoding for Pix and use
// FacilitatedPaymentsType enum.
UMA_HISTOGRAM_BOOLEAN("FacilitatedPayments.Pix.FopSelector.Shown", shown);
}

void LogUiScreenShown(UiState ui_screen) {
base::UmaHistogramEnumeration("FacilitatedPayments.Pix.UiScreenShown",
ui_screen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@ enum class PayflowExitedReason {
kMaxValue = kFopSelectorClosedByUser
};

// TODO(crbug.com/367751320): Remove after new PayflowExited histogram is
// finished.
// Reasons for why the payment was not offered. These only include the
// reasons after the renderer has detected a valid code and sent the signal to
// the browser process.
enum class PaymentNotOfferedReason {
kApiNotAvailable = 0,
kRiskDataEmpty = 1,
kCodeValidatorFailed = 2,
kInvalidCode = 3,
kLandscapeScreenOrientation = 4,
kMaxValue = kLandscapeScreenOrientation
};

// Log when a Pix code is copied to the clippboard on an allowlisted merchant
// website.
void LogPixCodeCopied(ukm::SourceId ukm_source_id);
Expand Down Expand Up @@ -106,13 +92,6 @@ void LogGetClientTokenResultAndLatency(bool result, base::TimeDelta duration);
// has been found.
void LogPayflowExitedReason(PayflowExitedReason reason);

// TODO(crbug.com/367751320): Remove after new PayflowExited histogram is
// finished.
// Log the reason for the payment option not offered to the user. This
// includes all the reasons after receiving a signal from the renderer process
// that a valid code has been found.
void LogPaymentNotOfferedReason(PaymentNotOfferedReason reason);

// Log the attempt to send the call to the InitiatePayment backend endpoint.
void LogInitiatePaymentAttempt();

Expand All @@ -138,11 +117,6 @@ void LogInitiatePurchaseActionResultUkm(const std::string& result,
// a string, remove this temporary conversion function.
uint8_t ConvertPurchaseActionResultToEnumValue(const std::string& result);

// Log whether the request to show the FOP(form of payment) selector is
// successful or not.
// TODO(crbug.com/377126728): Deprecate this method.
void LogFopSelectorShown(bool shown);

// Logs showing a new UI screen.
void LogUiScreenShown(UiState ui_screen);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,6 @@ TEST(FacilitatedPaymentsMetricsTest,
}
}

TEST(FacilitatedPaymentsMetricsTest, LogFopSelectorShown) {
base::HistogramTester histogram_tester;

LogFopSelectorShown(true);

histogram_tester.ExpectUniqueSample(
"FacilitatedPayments.Pix.FopSelector.Shown",
/*sample=*/true,
/*expected_bucket_count=*/1);
}

TEST(FacilitatedPaymentsMetricsTest, LogPixFopSelectorShownLatency) {
base::HistogramTester histogram_tester;

Expand Down Expand Up @@ -242,7 +231,7 @@ TEST_F(FacilitatedPaymentsMetricsUkmTest, LogPixCodeCopied) {
EXPECT_EQ(ukm_entries[0].metrics.at("PixCodeCopied"), true);
}

TEST_F(FacilitatedPaymentsMetricsUkmTest, LogFopSelectorShown) {
TEST_F(FacilitatedPaymentsMetricsUkmTest, LogFopSelectorShownUkm) {
LogFopSelectorShownUkm(ukm::UkmRecorder::GetNewSourceID());

auto ukm_entries = ukm_recorder_.GetEntries(
Expand Down

0 comments on commit 55561f5

Please sign in to comment.