Bug 1573837 - Add utm_* params to the "View full report on Firefox Monitor" link. r=johannh

Differential Revision: https://phabricator.services.mozilla.com/D42144

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Micah Tigley 2019-08-15 22:57:09 +00:00
Родитель cd5788b20f
Коммит 6de8405695
4 изменённых файлов: 11 добавлений и 13 удалений

Просмотреть файл

@ -1616,7 +1616,8 @@ pref("browser.contentblocking.report.lockwise.enabled", true);
// Enable Protections report's Monitor card by default.
pref("browser.contentblocking.report.monitor.enabled", true);
pref("browser.contentblocking.report.monitor.url", "https://monitor.firefox.com");
pref("browser.contentblocking.report.monitor.url", "https://monitor.firefox.com/?entrypoint=protection_report_monitor&utm_source=about-protections");
pref("browser.contentblocking.report.monitor.sign_in_url", "https://monitor.firefox.com/oauth/init?entrypoint=protection_report_monitor&utm_source=about-protections&email=");
pref("browser.contentblocking.report.lockwise.url", "https://lockwise.firefox.com/");
pref("browser.contentblocking.report.manage_devices.url", "https://accounts.firefox.com/settings/clients");

Просмотреть файл

@ -4,10 +4,14 @@
/* eslint-env mozilla/frame-script */
const MONITOR_SIGN_IN_URL = RPMGetStringPref(
const MONITOR_URL = RPMGetStringPref(
"browser.contentblocking.report.monitor.url",
""
);
const MONITOR_SIGN_IN_URL = RPMGetStringPref(
"browser.contentblocking.report.monitor.sign_in_url",
""
);
const HOW_IT_WORKS_URL_PREF = RPMGetFormatURLPref(
"browser.contentblocking.report.monitor.how_it_works.url"
);
@ -19,7 +23,7 @@ export default class MonitorClass {
init() {
const monitorLinkTag = this.doc.getElementById("monitor-inline-link");
monitorLinkTag.href = MONITOR_SIGN_IN_URL;
monitorLinkTag.href = MONITOR_URL;
RPMAddMessageListener("SendUserLoginsData", ({ data }) => {
// Wait for monitor data and display the card.
@ -99,16 +103,7 @@ export default class MonitorClass {
* @return URL to Monitor website.
*/
buildMonitorUrl(email = null) {
let url = MONITOR_SIGN_IN_URL;
if (email) {
url += `/oauth/init?email=${email}&entrypoint=protection_report_monitor&utm_source=about-protections`;
} else {
url +=
"/?entrypoint=protection_report_monitor&utm_source=about-protections";
}
return url;
return email ? `${MONITOR_SIGN_IN_URL}${email}` : MONITOR_URL;
}
renderContentForUserWithLogins(monitorData) {

Просмотреть файл

@ -14,6 +14,7 @@ add_task(async function setup() {
["browser.contentblocking.report.proxy.enabled", true],
// Change the endpoints to prevent non-local network connections when landing on the page.
["browser.contentblocking.report.monitor.url", ""],
["browser.contentblocking.report.monitor.sign_in_url", ""],
["browser.contentblocking.report.lockwise.url", ""],
],
});

Просмотреть файл

@ -67,6 +67,7 @@ let RPMAccessManager = {
"browser.contentblocking.category",
"browser.contentblocking.report.lockwise.url",
"browser.contentblocking.report.monitor.url",
"browser.contentblocking.report.monitor.sign_in_url",
"browser.contentblocking.report.manage_devices.url",
],
getFormatURLPref: [