From 693fac26ff6bd4255cf635c3b3475f9e4c33d2e6 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Fri, 21 Nov 2014 15:54:38 -0500 Subject: [PATCH] Bug 1099462 - Set the Getting Started URL for Loop. r=MattN --- browser/app/profile/firefox.js | 2 +- browser/components/loop/MozLoopService.jsm | 7 +++++-- browser/components/loop/content/js/panel.js | 4 ++-- browser/components/loop/content/js/panel.jsx | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 77e7355739a..09a9115e2bb 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1645,7 +1645,7 @@ pref("loop.enabled", true); 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/"); diff --git a/browser/components/loop/MozLoopService.jsm b/browser/components/loop/MozLoopService.jsm index d38e9e47aac..84eaae28c88 100644 --- a/browser/components/loop/MozLoopService.jsm +++ b/browser/components/loop/MozLoopService.jsm @@ -1421,9 +1421,12 @@ this.MozLoopService = { */ 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}); diff --git a/browser/components/loop/content/js/panel.js b/browser/components/loop/content/js/panel.js index c8ac6a56925..c1ec7f1a65e 100644 --- a/browser/components/loop/content/js/panel.js +++ b/browser/components/loop/content/js/panel.js @@ -166,7 +166,7 @@ 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); @@ -286,7 +286,7 @@ loop.panel = (function(_, mozL10n) { }, openGettingStartedTour: function() { - navigator.mozLoop.openGettingStartedTour("settingsMenu"); + navigator.mozLoop.openGettingStartedTour("settings-menu"); }, render: function() { diff --git a/browser/components/loop/content/js/panel.jsx b/browser/components/loop/content/js/panel.jsx index 1537b6a47d1..f4748d847bf 100644 --- a/browser/components/loop/content/js/panel.jsx +++ b/browser/components/loop/content/js/panel.jsx @@ -166,7 +166,7 @@ loop.panel = (function(_, mozL10n) { 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); @@ -286,7 +286,7 @@ loop.panel = (function(_, mozL10n) { }, openGettingStartedTour: function() { - navigator.mozLoop.openGettingStartedTour("settingsMenu"); + navigator.mozLoop.openGettingStartedTour("settings-menu"); }, render: function() {