Skip to content

feat(payments-next): Add payment method from Checkout to Glean metrics#20211

Merged
elizabeth-ilina merged 1 commit intomainfrom
PAY-3496-add-payment-method-from-checkout-to-glean-metrics
Mar 20, 2026
Merged

feat(payments-next): Add payment method from Checkout to Glean metrics#20211
elizabeth-ilina merged 1 commit intomainfrom
PAY-3496-add-payment-method-from-checkout-to-glean-metrics

Conversation

@elizabeth-ilina
Copy link
Contributor

@elizabeth-ilina elizabeth-ilina commented Mar 18, 2026

Because

  • We currently have the customer’s payment provider during Checkout included in Glean. It'd be helpful to also see how frequently each payment method is used.

This pull request

  • Adds payment method from Checkout to Glean metrics.
  • Populate subscription_payment_provider in libs/payments/metrics/src/lib/glean/utils/mapSubscription.ts
  • Corresponding data review below.

Issue that this pull request solves

Closes #PAY-3496

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.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

PayPal:
image

Stripe (card, link, apple pay, google pay):

card:

image

link:

image

apple pay:
image

google pay:
image

Other information (Optional)

Any other information that is important to this pull request.

@elizabeth-ilina elizabeth-ilina force-pushed the PAY-3496-add-payment-method-from-checkout-to-glean-metrics branch 9 times, most recently from 1aa5a73 to a3d0dea Compare March 19, 2026 15:57
Comment on lines +40 to +41
//console.log('this is paymentProvider in mapSubscription', paymentProvider);
//console.log('this is paymentMethod in mapSubscription', paymentMethod);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: remove before merging

@elizabeth-ilina elizabeth-ilina force-pushed the PAY-3496-add-payment-method-from-checkout-to-glean-metrics branch 2 times, most recently from 6528328 to b870749 Compare March 19, 2026 20:54
@elizabeth-ilina elizabeth-ilina marked this pull request as ready for review March 19, 2026 21:39
@elizabeth-ilina elizabeth-ilina requested a review from a team as a code owner March 19, 2026 21:39
@elizabeth-ilina
Copy link
Contributor Author

Request for data collection review form

  1. What questions will you answer with this data?
  • In addition to knowing a customer’s payment provider (such as Stripe or PayPal), we would also like to see how frequently each payment method (so far: Card, Link, Apple Pay, Google Pay, PayPal) is used during checkout.
  • Data review for the existing payment provider metric, subscription.payment_provider: Data Review: FxA/SubPlat Glean Tracking Metrics #18512
  1. Why does Mozilla need to answer these questions? Are there benefits for users? Do we need this information to address product or business requirements?
  • Understanding payment method usage helps Mozilla prioritize support and optimization for the most-used methods, directly improving the checkout experience for users.
  • Provides business intelligence on customer payment preferences to inform decisions about which payment methods to invest in, change, fix, improve, potentially add, or potentially remove (if more effort goes into supporting the payment method than is profitable).
  1. What alternative methods did you consider to answer these questions? Why were they not sufficient?
  • Stripe provides some payment method data, but it cannot be correlated with our checkout events or joined with other Glean metrics.
  • The existing subscription.payment_provider metric tells us who processes the payment (e.g., Stripe) but not how the customer chose to pay (Card vs. Apple Pay vs. Google Pay, etc.).
  1. Can current instrumentation answer these questions?
  • No. The existing Glean instrumentation includes the payment_provider (e.g., Stripe), but does not capture the specific payment method selected by the customer. This is the gap being filled.
  1. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories found on the Mozilla wiki.

Note that the data steward reviewing your request will characterize your data collection based on the highest (and most sensitive) category.

Measurement Name Measurement Description Data Collection Category Tracking Bug #
subscription.payment_method The payment method selected by the customer during checkout (e.g. 'card', 'link', 'apple_pay', 'google_pay', 'external_paypal') Category 2 https://mozilla-hub.atlassian.net/browse/PAY-3496
  1. Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.
  1. How long will this data be collected?
  • This collection will be collected permanently. subplat-team@mozilla.com will be responsible for the permanent collections.
  1. What populations will you measure?
  • All channels, countries, and locales. No filters.
  1. If this data collection is default on, what is the opt-out mechanism for users?
  • These collections are Glean. The opt-out can be found in the product's preferences. Session data will be recorded up until a user signs in with an account that has opted-out of metrics collection, or until they opt-out of collection, whichever comes first.
  1. Please provide a general description of how you will analyze this data.
  • We will work with DS and DE to create dashboards for analysis of the metrics.
  • The data will be analyzed as events, rather than reviewed as aggregate data.
  1. Where do you intend to share the results of your analysis?
  • The results of the analysis will be available to internal teams and NDA'd Mozillians only.
  1. Is there a third-party tool (i.e. not Glean or Telemetry) that you are proposing to use for this data collection? If so:
    No.

Because:

* We currently have the customer’s payment provider during Checkout included in Glean. It'd be helpful to also see how frequently each payment method is used.

This commit:

* Adds payment method from Checkout to Glean metrics.

Closes #[PAY-3496](https://mozilla-hub.atlassian.net/browse/PAY-3496)
@elizabeth-ilina elizabeth-ilina force-pushed the PAY-3496-add-payment-method-from-checkout-to-glean-metrics branch from b870749 to c978167 Compare March 20, 2026 20:18
@rocketsroger
Copy link

Request for data collection review form

1. What questions will you answer with this data?


* In addition to knowing a customer’s payment provider (such as Stripe or PayPal), we would also like to see how frequently each payment method (so far: Card, Link, Apple Pay, Google Pay, PayPal) is used during checkout.

* Data review for the existing payment provider metric, subscription.payment_provider: [Data Review: FxA/SubPlat Glean Tracking Metrics #18512](https://github.com/mozilla/fxa/issues/18512)


2. Why does Mozilla need to answer these questions?  Are there benefits for users? Do we need this information to address product or business requirements?


* Understanding payment method usage helps Mozilla prioritize support and optimization for the most-used methods, directly improving the checkout experience for users.

* Provides business intelligence on customer payment preferences to inform decisions about which payment methods to invest in, change, fix, improve, potentially add, or potentially remove (if more effort goes into supporting the payment method than is profitable).


3. What alternative methods did you consider to answer these questions? Why were they not sufficient?


* Stripe provides some payment method data, but it cannot be correlated with our checkout events or joined with other Glean metrics.

* The existing subscription.payment_provider metric tells us who processes the payment (e.g., Stripe) but not how the customer chose to pay (Card vs. Apple Pay vs. Google Pay, etc.).


4. Can current instrumentation answer these questions?


* No. The existing Glean instrumentation includes the payment_provider (e.g., Stripe), but does not capture the specific payment method selected by the customer. This is the gap being filled.


5. List all proposed measurements and indicate the category of data collection for each measurement, using the [Firefox data collection categories](https://wiki.mozilla.org/Data_Collection) found on the Mozilla wiki.

Note that the data steward reviewing your request will characterize your data collection based on the highest (and most sensitive) category.
Measurement Name Measurement Description Data Collection Category Tracking Bug #
subscription.payment_method The payment method selected by the customer during checkout (e.g. 'card', 'link', 'apple_pay', 'google_pay', 'external_paypal') Category 2 https://mozilla-hub.atlassian.net/browse/PAY-3496

6. Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.


* This collection is documented in the Glean Dictionary at https://dictionary.telemetry.mozilla.org/


7. How long will this data be collected?


* This collection will be collected permanently. [subplat-team@mozilla.com](mailto:subplat-team@mozilla.com) will be responsible for the permanent collections.


8. What populations will you measure?


* All channels, countries, and locales. No filters.


9. If this data collection is default on, what is the opt-out mechanism for users?


* These collections are Glean. The opt-out can be found in the product's preferences. Session data will be recorded up until a user signs in with an account that has opted-out of metrics collection, or until they opt-out of collection, whichever comes first.


10. Please provide a general description of how you will analyze this data.


* We will work with DS and DE to create dashboards for analysis of the metrics.

* The data will be analyzed as events, rather than reviewed as aggregate data.


11. Where do you intend to share the results of your analysis?


* The results of the analysis will be available to internal teams and NDA'd Mozillians only.


12. Is there a third-party tool (i.e. not Glean or Telemetry) that you are proposing to use for this data collection? If so:
    No.

Data Review

  1. Is there or will there be documentation that describes the schema for the ultimate data set in a public, complete, and accurate way?

This collection is documented in the Glean Dictionary at Glean Dictionary

  1. Is there a control mechanism that allows the user to turn the data collection on and off?

These collections are Glean. The opt-out can be found in the product's preferences. Session data will be recorded up until a user signs in with an account that has opted-out of metrics collection, or until they opt-out of collection, whichever comes first.

  1. If the request is for permanent data collection, is there someone who will monitor the data over time?

subplat-team@mozilla.com will be responsible for the permanent collections.

  1. Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?

Category 2, Interaction data

  1. Is the data collection request for default-on or default-off?

default-on, all channels, countries, and locales. No filters.

  1. Does the instrumentation include the addition of any new identifiers?

No

  1. Is the data collection covered by the existing Firefox privacy notice?

Yes

  1. Does the data collection use a third-party collection tool?

No

Result

data-review+

@elizabeth-ilina elizabeth-ilina merged commit 6b7b143 into main Mar 20, 2026
22 checks passed
@elizabeth-ilina elizabeth-ilina deleted the PAY-3496-add-payment-method-from-checkout-to-glean-metrics branch March 20, 2026 20:52
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