Bug 1833671 - Add Telemetry for Tabs from Other Devices r=kcochrane,fxview-reviewers,sclements

Differential Revision: https://phabricator.services.mozilla.com/D188670
This commit is contained in:
Jonathan Sudiaman
2023-09-20 20:59:21 +00:00
parent d7c0bdcc29
commit 4976d39f36
4 changed files with 121 additions and 2 deletions

View File

@@ -54,6 +54,10 @@ function openTabInWindow(window, url) {
switchToTabHavingURI(url, true, {});
}
function isFirefoxViewNext(window) {
return window.location.pathname === "firefoxview-next";
}
export const TabsSetupFlowManager = new (class {
constructor() {
this.QueryInterface = ChromeUtils.generateQI(["nsIObserver"]);
@@ -617,7 +621,10 @@ export const TabsSetupFlowManager = new (class {
);
this.didFxaTabOpen = true;
openTabInWindow(window, url, true);
Services.telemetry.recordEvent("firefoxview", "fxa_continue", "sync", null);
const category = isFirefoxViewNext(window)
? "firefoxview_next"
: "firefoxview";
Services.telemetry.recordEvent(category, "fxa_continue", "sync", null);
}
async openFxAPairDevice(window) {
@@ -626,7 +633,10 @@ export const TabsSetupFlowManager = new (class {
});
this.didFxaTabOpen = true;
openTabInWindow(window, url, true);
Services.telemetry.recordEvent("firefoxview", "fxa_mobile", "sync", null, {
const category = isFirefoxViewNext(window)
? "firefoxview_next"
: "firefoxview";
Services.telemetry.recordEvent(category, "fxa_mobile", "sync", null, {
has_devices: this.secondaryDeviceConnected.toString(),
});
}