Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1219)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLogger.java

Issue 2685623002: [Payments] Add completion metrics based on user had suggestions for all. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCanMakePaymentMetricsTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLogger.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLogger.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLogger.java
index 05c1d5ec569c4360c38be5a5039ef8a2e7e73746..1c81eccdeffe7e7f9565c979058859f61082b4f1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLogger.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLogger.java
@@ -21,10 +21,10 @@ public class PaymentRequestJourneyLogger {
public static final int CAN_MAKE_PAYMENT_NOT_USED = 1;
public static final int CAN_MAKE_PAYMENT_USE_MAX = 2;
- // Used to log CanMakePayment's effect on whether the transaction was completed.
- public static final int CMP_EFFECT_ON_COMPLETION_COMPLETED = 0;
- public static final int CMP_EFFECT_ON_COMPLETION_ABORTED = 1;
- public static final int CMP_EFFECT_ON_COMPLETION_MAX = 2;
+ // Used to log different parameters' effect on whether the transaction was completed.
+ public static final int COMPLETION_STATUS_COMPLETED = 0;
+ public static final int COMPLETION_STATUS_ABORTED = 1;
+ public static final int COMPLETION_STATUS_MAX = 2;
// Used to mesure the impact of the CanMakePayment return value on whether the Payment Request
// is shown to the user.
@@ -131,9 +131,8 @@ public class PaymentRequestJourneyLogger {
// Record the CanMakePayment metrics based on whether the transaction was completed or
// aborted by the user (UserAborted) or otherwise (OtherAborted).
- recordCanMakePaymentStats(submissionType.contains("Abort")
- ? CMP_EFFECT_ON_COMPLETION_ABORTED
- : CMP_EFFECT_ON_COMPLETION_COMPLETED);
+ recordCanMakePaymentStats(submissionType.contains("Abort") ? COMPLETION_STATUS_ABORTED
+ : COMPLETION_STATUS_COMPLETED);
}
/**
@@ -142,6 +141,9 @@ public class PaymentRequestJourneyLogger {
* @param submissionType A string indicating the way the payment request was concluded.
*/
private void recordSectionSpecificStats(String submissionType) {
+ // Record whether the user had suggestions for each requested information.
+ boolean userHadAllRequestedInformation = true;
+
for (int i = 0; i < mSections.length; ++i) {
String nameSuffix = "";
switch (i) {
@@ -178,8 +180,26 @@ public class PaymentRequestJourneyLogger {
"PaymentRequest.NumberOfSuggestionsShown." + nameSuffix,
Math.min(mSections[i].mNumberSuggestionsShown, MAX_EXPECTED_SAMPLE),
MIN_EXPECTED_SAMPLE, MAX_EXPECTED_SAMPLE, NUMBER_BUCKETS);
+
+ if (mSections[i].mNumberSuggestionsShown == 0) {
+ userHadAllRequestedInformation = false;
+ }
}
}
+
+ // Record metrics about completion based on whether the user had suggestions for each
+ // requested information.
+ int completionStatus = submissionType.contains("Abort") ? COMPLETION_STATUS_ABORTED
+ : COMPLETION_STATUS_COMPLETED;
+ if (userHadAllRequestedInformation) {
+ RecordHistogram.recordEnumeratedHistogram(
+ "PaymentRequest.UserHadSuggestionsForEverything.EffectOnCompletion",
+ completionStatus, COMPLETION_STATUS_MAX);
+ } else {
+ RecordHistogram.recordEnumeratedHistogram(
+ "PaymentRequest.UserDidNotHaveSuggestionsForEverything.EffectOnCompletion",
+ completionStatus, COMPLETION_STATUS_MAX);
+ }
}
/**
@@ -231,6 +251,6 @@ public class PaymentRequestJourneyLogger {
}
RecordHistogram.recordEnumeratedHistogram(
- histogramName, completionStatus, CMP_EFFECT_ON_COMPLETION_MAX);
+ histogramName, completionStatus, COMPLETION_STATUS_MAX);
}
}
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCanMakePaymentMetricsTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698