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

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: Reviews 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
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/manifest.json » ('j') | chrome/tools/chromeactions.txt » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..61f818c0e276352dee0c3302b9f4151e454552ef 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;
+ chrome.metricsPrivate.recordUserAction('GoogleNow.Dismissed');
+
rgustafson 2013/03/29 20:20:00 unnecessary new line
vadimt 2013/03/29 20:22:44 Yeah, I thought about this too. Given that it goes
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) {
+ chrome.metricsPrivate.recordUserAction('GoogleNow.MessageClicked');
onNotificationClicked(notificationId, function(actionUrls) {
return actionUrls.messageUrl;
});
@@ -523,6 +526,8 @@ chrome.notifications.onClicked.addListener(
chrome.notifications.onButtonClicked.addListener(
function(notificationId, buttonIndex) {
+ chrome.metricsPrivate.recordUserAction(
+ 'GoogleNow.ButtonClicked' + buttonIndex);
onNotificationClicked(notificationId, function(actionUrls) {
if (!Array.isArray(actionUrls.buttonUrls))
return undefined;
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/manifest.json » ('j') | chrome/tools/chromeactions.txt » ('J')

Powered by Google App Engine
This is Rietveld 408576698