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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java

Issue 2285633004: [TTS] Record CTR by week and 28-day intervals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctr
Patch Set: Reworked the cache to use a stored preference instead of session static data. Created 4 years, 3 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
Index: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
index 5dd1044979f1adda4bf98a3a8706b6df4feedf78..c8a9a6d1a65e1e73c3475c966c01ef3effa0aae0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
@@ -1171,6 +1171,30 @@ public class ContextualSearchUma {
}
/**
+ * Logs the number of impressions and CTR for the previous week for the current user.
+ * @param previousWeekImpressions The number of times the user saw the Contextual Search Bar.
+ * @param previousWeekCtr The CTR expressed as a percentage.
+ */
+ public static void logPreviousWeekCtr(int previousWeekImpressions, int previousWeekCtr) {
+ RecordHistogram.recordCountHistogram(
+ "Search.ContextualSearchPreviousWeekImpressions", previousWeekImpressions);
+ RecordHistogram.recordPercentageHistogram(
+ "Search.ContextualSearchPreviousWeekCtr", previousWeekCtr);
+ }
+
+ /**
+ * Logs the number of impressions and CTR for previous 28-day period for the current user.
+ * @param previous28DayImpressions The number of times the user saw the Contextual Search Bar.
+ * @param previous28DayCtr The CTR expressed as a percentage.
+ */
+ public static void logPrevious28DayCtr(int previous28DayImpressions, int previous28DayCtr) {
+ RecordHistogram.recordCountHistogram(
+ "Search.ContextualSearchPrevious28DayImpressions", previous28DayImpressions);
+ RecordHistogram.recordPercentageHistogram(
+ "Search.ContextualSearchPrevious28DayCtr", previous28DayCtr);
+ }
+
+ /**
* Get the encoded value to use for the Bar Overlap histogram by encoding all the input
* parameters.
* @param didBarOverlap Whether the selection overlapped the Bar position.

Powered by Google App Engine
This is Rietveld 408576698