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

Clean up Analytics Names #313

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Clean up Analytics Names #313

wants to merge 8 commits into from

Conversation

KunJeongPark
Copy link
Collaborator

@KunJeongPark KunJeongPark commented Dec 9, 2024

Summary of changes

  • Some card analytics events had "3ds" labels even when they may not have 3DS contingency
  • Use format <module>: <function>: <event>
    • For vault function, we are opting for vo-purchse instead of just vault to distinguish it from vault with purchase flow
  • Remove confirm-payment-source success/fail events
  • Create separate end events for success/fail for 3ds and non-3ds flows in parity with Android

Changes:

Card ApproveOrder:

Removed:

  1. remove card-payments:3ds:confirm-payment-source:succeeded (was sent for non-3ds flow along with general succeeded event)
  2. remove card-payments:3ds:confirm-payment-source:failed (was sent for non-3ds flow along with general failed event)

Added:

  1. Add card-payments:approve-order:auth-challenge:succeeded for card approval success with 3ds
  2. Add card-payments:approve-order:auth-challenge:failed for card approval failure with 3ds

Renamed:

  1. card-payments:3ds:started => card-payments:approve-order:started
  2. card-payments:3ds:confirm-payment-source:challenge-required -> card-payments:approve-order:auth-challenge-required
  3. card-payments:3ds:failed (this was previously used for both 3ds and non-3ds final result) -> card-payments:approve-order:failed
  4. card-payments:3ds:succeeded(this was previously used for both 3ds and non-3ds final result) -> card-payments:approve-order:succeeded
  5. card-payments:approve-order:challenge:user-canceled =>card-payments:approve-order:auth-challenge:canceled
  6. card-payments:3ds:challenge-presentation:succeeded => card-payments:approve-order:auth-challenge-presentation:succeeded
  7. card-payments:3ds:challenge-presentation:failed => card-payments:approve-order:auth-challenge-presentation:failed

Card Vault:

Remains same for non-3ds flows:

  1. card-payments:vault-wo-purchase:succeeded
  2. card-payments:vault-wo-purchase:failed
  3. card-payments:vault-wo-purchase:started

Added:

  1. card-payments:vault-wo-purchase:auth-challenge:succeeded for card vault success with 3ds
  2. card-payments:vault-wo-purchase:auth-challenge:failed for card vault failure with 3ds

Renamed:

  1. card-payments:3ds:challenge-presentation:challenge-required => card-payments:vault-wo-purchase:auth-challenge-required
  2. card-payments:3ds:challenge-presentation:succeeded => card-payments:vault-wo-purchase:auth-challenge-presentation:succeeded
  3. card-payments:3ds:challenge-presentation:failed => card-payments:vault-wo-purchase:auth-challenge-presentation:failed
  4. card-payments:vault-wo-purchase:challenge:canceled => card-payments:vault-wo-purchase:auth-challenge:canceled

PayPal Checkout:

Renamed:

  1. paypal-web-payments:started => paypal-web-payments:checkout:started
  2. paypal-web-payments:browser-presentation:succeeded => paypal-web-payments:checkout:auth-challenge-presentation:succeeded
  3. paypal-web-payments:browser-presentation:failed => paypal-web-payments:checkout:auth-challenge-presentation:failed
  4. paypal-web-payments:succeeded => paypal-web-payments:checkout:succeeded
  5. paypal-web-payments:failed => paypal-web-payments:checkout:failed
  6. paypal-web-payments:browser-login:canceled => paypal-web-payments:checkout:canceled

PayPal Vault:

Remains same:

  1. paypal-web-payments:vault-wo-purchase:started

Renamed:

  1. paypal-vault:browser-presentation:succeeded => paypal-web-payments:vault-wo-purchase:auth-challenge-presentation:succeeded
  2. paypal-web-payments:browser-presentation:failed => paypal-web-payments:vault-wo-purchase:auth-challenge-presentation:failed
  3. paypal-web-payments:vault-wo-purchase:succeeded => paypal-web-payments:vault-wo-purchase:succeeded
  4. paypal-web-payments:vault-wo-purchase:failed => paypal-web-payments:vault-wo-purchase:failed
  5. paypal-web-payments:vault-wo-purchase:canceled => paypal-web-payments:vault-wo-purchase:canceled

Main changes are having consistent analytic names across iOS and Android and separate success/fail end events for 3ds and non-3ds flows.

This is a draft as result of discussion with @sshropshire on cleaning up and coordinating iOS and Android analytic events

Checklist

- [ ] Added a changelog entry

Authors

List GitHub usernames for everyone who contributed to this pull request.

@KunJeongPark KunJeongPark requested a review from a team as a code owner December 9, 2024 21:02
@@ -113,19 +113,19 @@ public class CardClient: NSObject {
return
}

analyticsService?.sendEvent("card-payments:3ds:confirm-payment-source:challenge-required")
analyticsService?.sendEvent("card-payments:confirm-payment-source:challenge-required")
Copy link
Collaborator

Choose a reason for hiding this comment

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

On Android we do have every event related to approveOrder() named with approve-order. Here's an example in CardAnalytics.kt.

Copy link
Collaborator Author

@KunJeongPark KunJeongPark Dec 9, 2024

Choose a reason for hiding this comment

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

Yes, I had opened a PR yesterday to rename these events but closed it and wanted to just clean up things that were mislabeled as "3ds" in this PR. I wanted to hold off other changes until we have alignment in iOS/Android on analytic events.

@KunJeongPark
Copy link
Collaborator Author

KunJeongPark commented Dec 13, 2024

I am going to go ahead and put draft of changes for iOS here and will confirm with analytics team and Steven before merging. I think it'd be better than having to communicate changes twice.

@@ -161,25 +157,25 @@ public class CardClient: NSObject {
context: self,
sessionDidDisplay: { [weak self] didDisplay in
if didDisplay {
self?.analyticsService?.sendEvent("card-payments:3ds:challenge-presentation:succeeded")
self?.analyticsService?.sendEvent("card-payments:approve-order:auth-challenge-presentation:succeeded")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey I know we went over this in our meeting, but it seems like this event has a different format than <module>:<function>:<event>. Should we rename this to fit the schema?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

auth-challenge-presentation-succeeded/failed?

Copy link
Collaborator Author

@KunJeongPark KunJeongPark Jan 7, 2025

Choose a reason for hiding this comment

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

speaking of which, what do you think of end events for 3ds flows being auth-challenge:succeeded/failed/canceled as opposed to auth-challenge-succeeded/failed/canceled.
That way we can grab :succeeded, :failed, :canceled as final events
Let me check our original discussion about this but I personally like idea of :succeeded and :failed :canceled reserved for final events.

I guess that does make looking for events under <module>:<function> for example, messier.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah if we could stick to <module>:<function>:<event> i'd prefer it because it's clean. I prefer auth-challenge-succeeded/failed/canceled. It's verbose but it fits the schema, which makes it regex friendly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So what do you think about auth-challenge-presentation-succeeded/failed for your first point?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I think that works well. 👍 for auth-challenge-presentation-succeeded/failed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll run it by NN also and make changes on Confluence page.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey qq: if we keep this the way it is are we good to merge?

completion(nil, error)
}

private func notifyCheckoutCancelWithError(with error: CoreSDKError, completion: (CardResult?, CoreSDKError?) -> Void) {
analyticsService?.sendEvent("card-payments:3ds:challenge:user-canceled")
private func notify3dsCheckoutCancelWithError(with error: CoreSDKError, completion: (CardResult?, CoreSDKError?) -> Void) {

Choose a reason for hiding this comment

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

Should this method name be notify3dsCheckoutCancel(...) instead? Since the with error is part of the parameter name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes I wanted to be clear that now we are returning cancellation as an error.
Before we just returned didCancel in a separate delegate function.

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.

4 participants