Skip to content

feat(shared-metrics): Set up Glean frontend metrics for Churn intervention#20000

Merged
xlisachan merged 1 commit intomainfrom
PAY-3472
Mar 12, 2026
Merged

feat(shared-metrics): Set up Glean frontend metrics for Churn intervention#20000
xlisachan merged 1 commit intomainfrom
PAY-3472

Conversation

@xlisachan
Copy link
Copy Markdown
Contributor

@xlisachan xlisachan commented Feb 4, 2026

Because

  • we want to set up Glean frontend metrics for churn intervention

This pull request

  • Creates yaml file for Glean frontend metric definitions (page_view, retention_flow, interstitial_offer)
  • Updates pipeline/config
  • Creates glean-client.manager, factories, providers, types, tests in payments-metrics
  • Adds server actions and validators
  • Creates hook
  • Data review (https://bugzilla.mozilla.org/show_bug.cgi?id=2021134)

Issue that this pull request solves

Closes: PAY-3472

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.

@xlisachan xlisachan changed the title feat(shared-metrics): Add Glean for Churn feat(shared-metrics): Set up Glean frontend metrics for Churn intervention Feb 6, 2026
@xlisachan xlisachan force-pushed the PAY-3472 branch 3 times, most recently from 2f12f94 to cc61879 Compare February 24, 2026 18:36
@xlisachan xlisachan force-pushed the PAY-3472 branch 16 times, most recently from 9846065 to b516927 Compare March 9, 2026 21:03
@xlisachan xlisachan marked this pull request as ready for review March 9, 2026 21:04
@xlisachan xlisachan requested a review from a team as a code owner March 9, 2026 21:04
@xlisachan xlisachan force-pushed the PAY-3472 branch 4 times, most recently from 069c3bb to a676273 Compare March 11, 2026 13:04
Copy link
Copy Markdown
Contributor

@StaberindeZA StaberindeZA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

version: config.gleanClientConfig.version,
channel: config.gleanClientConfig.channel,
}
: undefined,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: update the type for config.gleanClientConfig to required

If the type is updated, then it should be possible to update this to just one line.

glean: config.gleanClientConfig 

"targets": {
"build": {
"dependsOn": ["l10n-bundle", "glean-generate"]
"dependsOn": ["l10n-bundle", "glean-generate", "payments-metrics:glean-generate-frontend"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: ah nice, I like this change. Keeps the logic with the library. Should probably consider, as a polish PR at another time, updating glean-generate to follow this pattern as well.

Comment on lines +102 to +105
@Type(() => PaymentsGleanClientConfig)
@ValidateNested()
@IsDefined()
public readonly gleanClientConfig!: Partial<PaymentsGleanClientConfig>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Do not add gleanClientConfig to nestapp/config as it is not used by the NestApp

Instead could this be moved to the payments/next/app/config instead?


import { getApp } from '../nestapp/app';

export async function getMetricsOptOutAction(uid: string) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: What's the purpose of this action?

If it is to retrieve a users metrics preferences, could I suggest an alternative approach?

suggestion: update auth session to include users metrics preferences

If I remember correctly, during the payments-next auth flow when retrieving the users info, the users metrics preferences are included. At this time that info could be added to the auth session, which can then easily be retrieved on the client.

Comment thread .circleci/config.yml
name: Wait for Customs
command: yarn workspace fxa-customs-server start

ensure-glean-venv:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: is it necessary to include this? If it's already included in the docker image, isn't it guaranteed that it'll be available?

@xlisachan xlisachan force-pushed the PAY-3472 branch 2 times, most recently from 398f9c0 to d794f8d Compare March 11, 2026 15:18
@xlisachan xlisachan force-pushed the PAY-3472 branch 12 times, most recently from 8635d52 to 8e45cd4 Compare March 12, 2026 14:19
- [x] Creates yaml file for Glean frontend metric definitions (page_view, retention_flow, interstitial_offer)
- [x] Updates pipeline/config
- [x] Creates glean-client.manager, factories, providers, types, tests in payments-metrics
- [x] Adds server actions and validators
- [x] Creates hook
- [x] Data review (https://bugzilla.mozilla.org/show_bug.cgi?id=2021134)

Closes: PAY-3472
@xlisachan xlisachan merged commit dbbbf24 into main Mar 12, 2026
19 of 21 checks passed
@xlisachan xlisachan deleted the PAY-3472 branch March 12, 2026 14:39
@vbudhram
Copy link
Copy Markdown
Contributor

@xlisachan 20000!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants