Bug 1099462 - Set the Getting Started URL for Loop. r=MattN a=lsblakk
authorJared Wein <jwein@mozilla.com>
Fri, 21 Nov 2014 15:54:38 -0500
changeset 234053 749a29e73e9106f0e540f09334de5e1cf9d1a012
parent 234052 fe00ed502c9f20bc4ce68236ec9e61e01a6f1288
child 234054 6d5163d6bf13c1fdc5d794fcf66928e18ba65096
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN, lsblakk
bugs1099462
milestone35.0a2
Bug 1099462 - Set the Getting Started URL for Loop. r=MattN a=lsblakk
browser/app/profile/firefox.js
browser/components/loop/MozLoopService.jsm
browser/components/loop/content/js/panel.js
browser/components/loop/content/js/panel.jsx
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1638,17 +1638,17 @@ pref("loop.enabled", true);
 pref("loop.throttled2", true);
 pref("loop.soft_start_ticket_number", -1);
 pref("loop.soft_start_hostname", "soft-start.loop.services.mozilla.com");
 #endif
 
 pref("loop.server", "https://loop.services.mozilla.com/v0");
 pref("loop.seenToS", "unseen");
 pref("loop.gettingStarted.seen", false);
-pref("loop.gettingStarted.url", "https://bugzilla.mozilla.org/show_bug.cgi?id=1099462");
+pref("loop.gettingStarted.url", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/hello/start");
 pref("loop.learnMoreUrl", "https://www.firefox.com/hello/");
 pref("loop.legal.ToS_url", "https://hello.firefox.com/legal/terms/");
 pref("loop.legal.privacy_url", "https://www.mozilla.org/privacy/");
 pref("loop.do_not_disturb", false);
 pref("loop.ringtone", "chrome://browser/content/loop/shared/sounds/ringtone.ogg");
 pref("loop.retry_delay.start", 60000);
 pref("loop.retry_delay.limit", 300000);
 pref("loop.feedback.baseUrl", "https://input.mozilla.org/api/v1/feedback");
--- a/browser/components/loop/MozLoopService.jsm
+++ b/browser/components/loop/MozLoopService.jsm
@@ -1512,19 +1512,22 @@ this.MozLoopService = {
   /**
    * Opens the Getting Started tour in the browser.
    *
    * @param {String} aSrc
    *   - The UI element that the user used to begin the tour, optional.
    */
   openGettingStartedTour: Task.async(function(aSrc = null) {
     try {
-      let url = new URL(Services.prefs.getCharPref("loop.gettingStarted.url"));
+      let urlStr = Services.prefs.getCharPref("loop.gettingStarted.url");
+      let url = new URL(Services.urlFormatter.formatURL(urlStr));
       if (aSrc) {
-        url.searchParams.set("source", aSrc);
+        url.searchParams.set("utm_source", "firefox-browser");
+        url.searchParams.set("utm_medium", "firefox-browser");
+        url.searchParams.set("utm_campaign", aSrc);
       }
       let win = Services.wm.getMostRecentWindow("navigator:browser");
       win.switchToTabHavingURI(url, true, {replaceQueryString: true});
     } catch (ex) {
       log.error("Error opening Getting Started tour", ex);
     }
   }),
 
--- a/browser/components/loop/content/js/panel.js
+++ b/browser/components/loop/content/js/panel.js
@@ -161,17 +161,17 @@ loop.panel = (function(_, mozL10n) {
           )
         )
       );
     }
   });
 
   var GettingStartedView = React.createClass({displayName: 'GettingStartedView',
     handleButtonClick: function() {
-      navigator.mozLoop.openGettingStartedTour();
+      navigator.mozLoop.openGettingStartedTour("getting-started");
       navigator.mozLoop.setLoopPref("gettingStarted.seen", true);
       var event = new CustomEvent("GettingStartedSeen");
       window.dispatchEvent(event);
     },
 
     render: function() {
       if (navigator.mozLoop.getLoopPref("gettingStarted.seen")) {
         return null;
@@ -281,17 +281,17 @@ loop.panel = (function(_, mozL10n) {
       }
     },
 
     _isSignedIn: function() {
       return !!navigator.mozLoop.userProfile;
     },
 
     openGettingStartedTour: function() {
-      navigator.mozLoop.openGettingStartedTour("settingsMenu");
+      navigator.mozLoop.openGettingStartedTour("settings-menu");
     },
 
     render: function() {
       var cx = React.addons.classSet;
 
       // For now all of the menu entries require FxA so hide the whole gear if FxA is disabled.
       if (!navigator.mozLoop.fxAEnabled) {
         return null;
--- a/browser/components/loop/content/js/panel.jsx
+++ b/browser/components/loop/content/js/panel.jsx
@@ -161,17 +161,17 @@ loop.panel = (function(_, mozL10n) {
           </ul>
         </div>
       );
     }
   });
 
   var GettingStartedView = React.createClass({
     handleButtonClick: function() {
-      navigator.mozLoop.openGettingStartedTour();
+      navigator.mozLoop.openGettingStartedTour("getting-started");
       navigator.mozLoop.setLoopPref("gettingStarted.seen", true);
       var event = new CustomEvent("GettingStartedSeen");
       window.dispatchEvent(event);
     },
 
     render: function() {
       if (navigator.mozLoop.getLoopPref("gettingStarted.seen")) {
         return null;
@@ -281,17 +281,17 @@ loop.panel = (function(_, mozL10n) {
       }
     },
 
     _isSignedIn: function() {
       return !!navigator.mozLoop.userProfile;
     },
 
     openGettingStartedTour: function() {
-      navigator.mozLoop.openGettingStartedTour("settingsMenu");
+      navigator.mozLoop.openGettingStartedTour("settings-menu");
     },
 
     render: function() {
       var cx = React.addons.classSet;
 
       // For now all of the menu entries require FxA so hide the whole gear if FxA is disabled.
       if (!navigator.mozLoop.fxAEnabled) {
         return null;