Index: components/autofill/core/browser/autofill_metrics.cc |
diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc |
index be8e8ef8513b0bbbeaedf265f55f1f731155c01e..9fd4a5f4302027ef0d8e2452c89b43e76de10b0d 100644 |
--- a/components/autofill/core/browser/autofill_metrics.cc |
+++ b/components/autofill/core/browser/autofill_metrics.cc |
@@ -631,13 +631,22 @@ void AutofillMetrics::FormEventLogger::OnDidInteractWithAutofillableForm() { |
} |
} |
-void AutofillMetrics::FormEventLogger::OnDidPollSuggestions() { |
- if (is_for_credit_card_) { |
- base::RecordAction( |
- base::UserMetricsAction("Autofill_PolledCreditCardSuggestions")); |
- } else { |
- base::RecordAction( |
- base::UserMetricsAction("Autofill_PolledProfileSuggestions")); |
+void AutofillMetrics::FormEventLogger::OnDidPollSuggestions( |
+ const FormFieldData& field) { |
+ // Record only one poll user action for consecutive polls of the same field. |
+ // This is to avoid recording too many poll actions (for example when a user |
+ // types in a field, triggering multiple queries) to make the analysis more |
+ // simple. |
+ if (!field.SameFieldAs(last_polled_field_)) { |
+ if (is_for_credit_card_) { |
+ base::RecordAction( |
+ base::UserMetricsAction("Autofill_PolledCreditCardSuggestions")); |
+ } else { |
+ base::RecordAction( |
+ base::UserMetricsAction("Autofill_PolledProfileSuggestions")); |
+ } |
+ |
+ last_polled_field_ = field; |
} |
} |