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

Unified Diff: chrome/browser/resources/google_now/background.js

Issue 13180002: Adding metrics for notification clicks and dismissals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/browser/resources/google_now/background.js
diff --git a/chrome/browser/resources/google_now/background.js b/chrome/browser/resources/google_now/background.js
index 32830a4bbbd4d3d89eafadb629a67892f41e1646..f74a22d18d2212680f48204297eb5a939ddfd376 100644
--- a/chrome/browser/resources/google_now/background.js
+++ b/chrome/browser/resources/google_now/background.js
@@ -438,6 +438,8 @@ function onNotificationClosed(notificationId, byUser) {
if (!byUser)
return;
+ metrics.recordUserAction('Dismissed');
+
tasks.add(DISMISS_CARD_TASK_NAME, function(callback) {
// Schedule retrying dismissing until all dismissals go through.
// TODO(vadimt): Implement exponential backoff and unify it with getting
@@ -516,6 +518,7 @@ chrome.alarms.onAlarm.addListener(function(alarm) {
chrome.notifications.onClicked.addListener(
function(notificationId) {
+ metrics.recordUserAction('MessageClicked');
onNotificationClicked(notificationId, function(actionUrls) {
return actionUrls.messageUrl;
});
@@ -523,6 +526,7 @@ chrome.notifications.onClicked.addListener(
chrome.notifications.onButtonClicked.addListener(
function(notificationId, buttonIndex) {
+ metrics.recordUserAction('ButtonClicked' + buttonIndex);
onNotificationClicked(notificationId, function(actionUrls) {
if (!Array.isArray(actionUrls.buttonUrls))
return undefined;

Powered by Google App Engine
This is Rietveld 408576698