diff --git a/rollup.config.js b/rollup.config.js index 5a694a5b6..d3168d3ac 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -111,12 +111,6 @@ export default { "process.env.NODE_ENV": JSON.stringify( production ? "production" : "development" ), - // These environment variables are always strings, - // so _any_ value will be read as `true` here - // i.e. GLEAN_LOG_PINGS=false will become `true` here. - // The only option when GLEAN_LOG_PINGS is `false` is when it is not set at all - GLEAN_LOG_PINGS: !!process.env.GLEAN_LOG_PINGS, - GLEAN_DEBUG_VIEW_TAG: process.env.GLEAN_DEBUG_VIEW_TAG || "", GLEAN_SOURCE_TAGS: process.env.GLEAN_SOURCE_TAGS || "", __DISPLAY_VERSION__: execSync("git describe --abbrev=0 --tags") .toString() diff --git a/src/telemetry/index.js b/src/telemetry/index.js index 3e4707630..514e8e409 100644 --- a/src/telemetry/index.js +++ b/src/telemetry/index.js @@ -1,8 +1,10 @@ // ESlint does not support subpath exports, which are used by Glean. // https://github.com/import-js/eslint-plugin-import/issues/1868 // -// eslint-disable-next-line import/no-unresolved +/* eslint-disable import/no-unresolved */ import Glean from "@mozilla/glean/web"; +import GleanMetrics from "@mozilla/glean/metrics"; +/* eslint-enable import/no-unresolved */ import { googleAnalytics } from "./ga"; @@ -42,17 +44,6 @@ export function initializeTelemetry() { }); /* eslint-disable no-undef, no-constant-condition */ - - // GLEAN_LOG_PINGS is a boolean value, - // thus it should not have quotes around it. - if (GLEAN_LOG_PINGS === true) { - Glean.setLogPings(true); - } - - if ("GLEAN_DEBUG_VIEW_TAG") { - Glean.setDebugViewTag("GLEAN_DEBUG_VIEW_TAG"); - } - if ("GLEAN_SOURCE_TAGS") { // GLEAN_SOURCE_TAGS is supposed to be a comma separated string of tags const sourceTags = "GLEAN_SOURCE_TAGS".split(",").map((tag) => tag.trim()); @@ -74,6 +65,9 @@ export function submitPageViewTelemetry(path) { ga("send", "pageview"); } + // Use the standard events. + GleanMetrics.pageLoad({ url: path }); + // Send telemetry to Glean. pageMetrics.loaded.set(); // Remove query params and trailing `/` characters.