Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log preset_selected in the applepay_ui_confirm event #4658

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

tonisevener
Copy link
Collaborator

Phabricator:
https://phabricator.wikimedia.org/T346086

Link to more discussion: https://docs.google.com/presentation/d/1vZZwXb0rOGFlqvSy5PxxqRVy83ORPBAwYVHisfp4_o0/edit?disco=AAAA6dNQPAg

Notes

Analytics wants to be able to track if a user entered a custom amount in the donate form. I had difficulty hooking into this from the SwiftUI currency textfield without a lot of programmatic misfires, so instead we are sending an additional flag upon authorization of the payment sheet indicating if they have an amount preset button selected.

{
  "app_session_id" : "066fe4b6c88c3891e8bf",
  "primary_language" : "en",
  "active_interface" : "applepay_processed",
  "action" : "applepay_ui_confirm",
  "action_data" : "...preset_selected:true...",
  "platform" : "ios",
  "is_anon" : false,
...

Test Steps

Local-only changes: Add WKDataEnvironment.current.basicService = WKMockBasicService() to this area to fake all the payment endpoints.

  1. Log into iOS Sandbox Tester Apple ID (see 1Password) in test device iOS Settings. Do not enable 2 factor auth.
    In Wallet app, add Test Apple Pay card.
  2. Change device region to NL or IT.
  3. On Staging scheme, fresh install and launch app.
  4. In app Settings, turn on logging.
  5. Go through Donate with Apple Pay form, after authorizing on payment sheet you should see an payload printed out to the console similar to the one above. Confirm action_data has preset_selected:true if an amount button is selected, and preset_selected:false if no amount button is selected.

@staykids staykids self-assigned this Oct 12, 2023
Copy link
Contributor

@staykids staykids left a comment

Choose a reason for hiding this comment

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

👍🏽 looks like preset_selected is populating as expected in the actionData property during logging event initialization.

@staykids staykids merged commit 10ec318 into main Oct 12, 2023
2 checks passed
@staykids staykids deleted the add-preset-selected-metric branch October 12, 2023 19:05
@staykids staykids removed their assignment Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants