export function initializeTelemetry()

in src/telemetry/index.js [27:50]


export function initializeTelemetry() {
  // Initialize Google Analytics only if DNT is not enabled.
  if ("__GOOGLE_ANALYTICS_ID__".length && !isDNTEnabled)
    googleAnalytics("__GOOGLE_ANALYTICS_ID__");

  // Initialize Glean regardless whether DNT is enabled,
  // however give Glean the DNT stats as the uploadEnabled status.
  //
  // If DNT is enabled Glean will _not_ upload any telemetry
  // other than the deletion-request ping.
  Glean.initialize("__GLEAN_APPLICATION_ID__", !isDNTEnabled, {
    appBuild: "__VERSION__",
    appDisplayVersion: "__DISPLAY_VERSION__",
    enableAutoElementClickEvents: true,
  });

  /* eslint-disable no-undef, no-constant-condition */
  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());
    Glean.setSourceTags(sourceTags);
  }
  /* eslint-enable no-undef */
}