Skip to content

feat(payments-next): Implement Glean frontend metrics for Churn intervention#20166

Merged
xlisachan merged 1 commit intomainfrom
PAY-3471
Mar 23, 2026
Merged

feat(payments-next): Implement Glean frontend metrics for Churn intervention#20166
xlisachan merged 1 commit intomainfrom
PAY-3471

Conversation

@xlisachan
Copy link
Contributor

@xlisachan xlisachan commented Mar 10, 2026

This pull request

  • Implements the following:
    • Page_view for Subscription Management
    • Retention_flow
      • Cancel flow + Error
      • Stay flow + Error
    • Interstitial_offer
      • Offer + Error

Issue that this pull request solves

Closes: PAY-3471

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.

Screenshot

Page View - Subscription Management

Screenshot 2026-03-16 at 10 45 09 AM

Retention Flow

Churn Cancel Flow - cancel subscription

View
Screenshot 2026-03-16 at 10 45 57 AM

Engage
Screenshot 2026-03-16 at 10 46 24 AM

Submit
Screenshot 2026-03-16 at 10 46 47 AM

Result
Screenshot 2026-03-16 at 10 47 54 AM

Churn Cancel Flow - redeem coupon

View
Screenshot 2026-03-16 at 10 50 01 AM

Engage
Screenshot 2026-03-16 at 10 50 19 AM

Submit
Screenshot 2026-03-16 at 10 50 37 AM

Result
Screenshot 2026-03-16 at 10 50 58 AM

Churn Stay Flow

View
Screenshot 2026-03-16 at 10 55 50 AM

Engage
Screenshot 2026-03-16 at 10 57 17 AM

Submit
Screenshot 2026-03-16 at 10 57 31 AM

Result
Screenshot 2026-03-16 at 10 57 57 AM

Interstitial Offer

View
Screenshot 2026-03-16 at 10 53 38 AM

Cancel subscription

Engage
Screenshot 2026-03-16 at 10 54 13 AM

Submit
Screenshot 2026-03-16 at 10 54 33 AM

Result
Screenshot 2026-03-16 at 10 54 48 AM

Upgrade

Engage - note: this action has been updated to 'offer' to distinguish from the second engage (action: upgrade) in the Offer lifecycle
Screenshot 2026-03-16 at 10 58 38 AM

View - Upgrade page
Screenshot 2026-03-16 at 10 59 14 AM

Engage
Screenshot 2026-03-16 at 11 00 01 AM

Submit
Screenshot 2026-03-16 at 10 59 40 AM

Result
Screenshot 2026-03-16 at 11 00 39 AM

@xlisachan xlisachan changed the title Pay 3471 feat(payments-next): Implement Glean churn metrics Mar 10, 2026
@xlisachan xlisachan changed the title feat(payments-next): Implement Glean churn metrics feat(payments-next): Implement Glean frontend metrics for Churn intervention Mar 10, 2026
@xlisachan xlisachan force-pushed the PAY-3472 branch 11 times, most recently from 8e45cd4 to 71caeba Compare March 12, 2026 14:21
Base automatically changed from PAY-3472 to main March 12, 2026 14:39
@xlisachan xlisachan force-pushed the PAY-3471 branch 16 times, most recently from 6fc8d7a to 8fdab4f Compare March 16, 2026 16:26
RUN _scripts/l10n/clone.sh
RUN yarn install --immutable;
RUN yarn install --immutable \
&& rm -rf .venv \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once this PR is merged, L29-31 can be removed.

python3 --version
rm -rf .venv
python3 -m venv .venv --without-pip
python3 -m venv .venv
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once this PR is merged, ensure-glean-venv and all its usages can be removed.

@xlisachan xlisachan marked this pull request as ready for review March 16, 2026 18:03
@xlisachan xlisachan requested a review from a team as a code owner March 16, 2026 18:03
@xlisachan xlisachan force-pushed the PAY-3471 branch 2 times, most recently from ddb2a3d to fef4669 Compare March 16, 2026 18:37
<GleanPageView
metricsEnabled={session?.user?.metricsEnabled ?? true}
pageMetrics={{ pageName: 'management', entrypoint }}
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are no changes below this, I'm not sure why GitHub is saying there were. 😒

if (
reason === 'eligible' &&
!cancelContent.cancelAtPeriodEnd &&
cancelContent.active
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be considered a 'view' if the customer saw the churn content messaging, and would not be a 'view' if they have refreshed the page after having either successfully redeemed a coupon or canceled their subscription.

staySubscribedContent.active
) {
glean.recordRetentionFlowView(retentionFlowBase);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be considered a 'view' if the customer saw the churn content messaging, and would not be a 'view' if they have refreshed the page after having either successfully redeemed a coupon or decided to remain canceled.

useEffect(() => {
if (pageContent && !cancelAtPeriodEnd) {
glean.recordInterstitialOfferView(interstitialOfferBase);
}
Copy link
Contributor Author

@xlisachan xlisachan Mar 16, 2026

Choose a reason for hiding this comment

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

It would be considered a 'view' if the customer saw the offer content.

Comment on lines +47 to +48
// Glean.setDebugViewTag('payments-frontend');
// Glean.setLogPings(true);
Copy link
Member

Choose a reason for hiding this comment

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

[nit] Commented code

action: 'upgrade',
});
}
}, []); // eslint-disable-line
Copy link
Member

Choose a reason for hiding this comment

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

Can we state a specific rule here rather than a full disable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the comment can actually be removed.

) {
glean.recordRetentionFlowView(retentionFlowBase);
}
}, []); // eslint-disable-line
Copy link
Member

Choose a reason for hiding this comment

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

Same comment

) {
glean.recordRetentionFlowView(retentionFlowBase);
}
}, []); // eslint-disable-line
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Comment on lines +224 to +225
// TODO: This is a workaround to match existing legacy behavior.
// Fix as part of redesign
Copy link
Member

Choose a reason for hiding this comment

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

Can we cite a specific ticket here?

…vention

This pull request
- Implements the following:
  - Page_view for Subscription Management
  - Retention_flow for Cancel and Stay (and Error)
  - Interstitial_offer for Offer (and Error)

Closes PAY-3471
@xlisachan xlisachan merged commit 20874a4 into main Mar 23, 2026
22 checks passed
@xlisachan xlisachan deleted the PAY-3471 branch March 23, 2026 18:12
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.

2 participants