Skip to content

Commit

Permalink
[Bug 1885857] Remove non standard page load events (#2158)
Browse files Browse the repository at this point in the history
* Stop using non standard (app defined) page load events

  - Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1885857
  - Left the metrics.yaml and pings.yaml files but removed everything from them
    to allow experimenting with events in future without making changes to
    builtin Glean events
  • Loading branch information
abhi-agg authored Mar 21, 2024
1 parent c3402d1 commit a6caeb6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 62 deletions.
12 changes: 1 addition & 11 deletions src/telemetry/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import GleanMetrics from "@mozilla/glean/metrics";

import { googleAnalytics } from "./ga";

// Glean generated metrics and pings files
import * as pageMetrics from "./generated/page";
import { pageView as pageViewPing } from "./generated/pings";

// detecting "do not track" via these instructions:
// https://dev.to/corbindavenport/how-to-correctly-check-for-do-not-track-with-javascript-135d
const isDNTEnabled =
Expand Down Expand Up @@ -66,12 +62,6 @@ export function submitPageViewTelemetry(path) {
});
}

// Use the standard events.
// Use the standard (built-in Glean) page load events.
GleanMetrics.pageLoad({ url: path });

// Send telemetry to Glean.
pageMetrics.loaded.set();
// Remove query params and trailing `/` characters.
pageMetrics.path.set(path.split("?")[0].replace(/\/$/, ""));
pageViewPing.submit();
}
38 changes: 0 additions & 38 deletions src/telemetry/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,3 @@

---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0

page:
loaded:
type: datetime
lifetime: ping
send_in_pings:
- page-view
description: |
The time the page was loaded.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1741582
data_reviews:
- https://github.com/mozilla/glean-dictionary/pull/1015#issuecomment-996051009
data_sensitivity:
- interaction
notification_emails:
- brizental@mozilla.com
- glean-team@mozilla.com
expires: never
path:
type: string
lifetime: ping
send_in_pings:
- page-view
description: |
The path of the page that was loaded.
Query arguments will be stripped before recording.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1741582
data_reviews:
- https://github.com/mozilla/glean-dictionary/pull/1015#issuecomment-996051009
data_sensitivity:
- interaction
notification_emails:
- brizental@mozilla.com
- glean-team@mozilla.com
expires: never
13 changes: 0 additions & 13 deletions src/telemetry/pings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,3 @@

---
$schema: moz://mozilla.org/schemas/glean/pings/2-0-0

page-view:
description: |
A ping that will be sent everytime a new page is visited.
include_client_id: true
send_if_empty: false
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1741582
data_reviews:
- https://github.com/mozilla/glean-dictionary/pull/1015#issuecomment-996051009
notification_emails:
- brizental@mozilla.com
- glean-team@mozilla.com

0 comments on commit a6caeb6

Please sign in to comment.