Bug 1017191 - Follow-up: Use message.id in home banner telemetry instead of randomized id. r=margaret, a=lmandel
authorChenxia Liu <liuche@mozilla.com>
Thu, 29 May 2014 15:59:02 -0700
changeset 199362 43f0dcd7eca55521feff499fc778b2968a795720
parent 199361 63cd4aa566c54211bce019b392ee6525e1b56335
child 199363 c5a58d90da90ee36323c5fba7720f2db52eb611e
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, lmandel
bugs1017191
milestone31.0a2
Bug 1017191 - Follow-up: Use message.id in home banner telemetry instead of randomized id. r=margaret, a=lmandel
mobile/android/components/Snippets.js
--- a/mobile/android/components/Snippets.js
+++ b/mobile/android/components/Snippets.js
@@ -198,23 +198,23 @@ function updateBanner(messages) {
       return;
     }
     let id = Home.banner.add({
       text: message.text,
       icon: message.icon,
       onclick: function() {
         let parentId = gChromeWin.BrowserApp.selectedTab.id;
         gChromeWin.BrowserApp.addTab(message.url, { parentId: parentId });
-        UITelemetry.addEvent("action.1", "banner", null, id);
+        UITelemetry.addEvent("action.1", "banner", null, message.id);
       },
       ondismiss: function() {
         // Remove this snippet from the banner, and store its id so we'll never show it again.
         Home.banner.remove(id);
         removeSnippet(message.id);
-        UITelemetry.addEvent("cancel.1", "banner", null, id);
+        UITelemetry.addEvent("cancel.1", "banner", null, message.id);
       },
       onshown: function() {
         // 10% of the time, record the snippet id and a timestamp
         if (Math.random() < .1) {
           writeStat(message.id, new Date().toISOString());
         }
       }
     });
@@ -354,24 +354,24 @@ function loadSyncPromoBanner() {
       let id = Home.banner.add({
         text: text + "<a href=\"#\">" + link + "</a>",
         icon: "drawable://sync_promo",
         onclick: function() {
           // Remove the message, so that it won't show again for the rest of the app lifetime.
           Home.banner.remove(id);
           Accounts.launchSetup();
 
-          UITelemetry.addEvent("action.1", "banner", null, id);
+          UITelemetry.addEvent("action.1", "banner", null, "syncpromo");
         },
         ondismiss: function() {
           // Remove the sync promo message from the banner and never try to show it again.
           Home.banner.remove(id);
           Services.prefs.setBoolPref("browser.snippets.syncPromo.enabled", false);
 
-          UITelemetry.addEvent("cancel.1", "banner", null, id);
+          UITelemetry.addEvent("cancel.1", "banner", null, "syncpromo");
         }
       });
     },
     (err) => {
       Cu.reportError("Error checking whether sync account exists: " + err);
     }
   );
 }