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

Add button analytics #261

Merged
merged 5 commits into from
Mar 13, 2024
Merged

Add button analytics #261

merged 5 commits into from
Mar 13, 2024

Conversation

vradopp
Copy link
Contributor

@vradopp vradopp commented Mar 7, 2024

Reason for changes

Log payment button usage

Summary of changes

  • Added button_type which is an existing tag to track the type of button used
  • Added events for payment-button:tapped and payment-button:initialized

Checklist

- [ ] Added a changelog entry

Authors

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

  • vradopp

@vradopp vradopp requested a review from a team as a code owner March 7, 2024 19:23
@scannillo
Copy link
Collaborator

Changes look good! Another nit - but I think we do want a CHANGELOG entry here, it helps future us track which version we added these analytics in

@@ -36,7 +46,9 @@ public class PaymentButton: UIButton {
self.size = size
self.insets = insets
self.label = label
self.analyticsService.sendEvent("paypal-button:initialized", buttonType: fundingSource.rawValue)
Copy link
Collaborator

Choose a reason for hiding this comment

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

General question: do we want to send a specific event for each PaymentButton subclass - so credit, pay later, paypal. Or are we sending the same event name for all buttons?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its the same event name for all buttons but we also pass the buttonType which would be one of PayPal Pay Later or Credit

Copy link
Collaborator

Choose a reason for hiding this comment

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

🤦 it certainly helps if I could read, sorry just totally missed the second half of this event. Take it or leave it, but is it worth considering payment-button as the naming here? Wondering incase we add something like a Venmo button in the future would we reused this class.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like that idea!

Copy link
Collaborator

Choose a reason for hiding this comment

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

@vradopp what do you think about updating the events in this PR to "payment-button" vs "paypal-button"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me! Just updated

Copy link
Contributor

@stechiu stechiu left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@jaxdesmarais jaxdesmarais left a comment

Choose a reason for hiding this comment

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

🚀 thanks for making that update!

@saperi22
Copy link
Contributor

saperi22 commented Mar 12, 2024

@vradopp

Added button_type which is an existing tag to track the type of button used

do you mind pointing me where to look for existing tags? Not sure how to verify if button_type is an existing tag.

@jaxdesmarais
Copy link
Collaborator

do you mind pointing me where to look for existing tags? Not sure how to verify if button_type is an existing tag.

I can help answer this! If you go to go/fptiexplorer and click on tags on the lefthand side you can search for approved FPTI tags. Generally we want to reuse already approved tags vs creating new tags.

@vradopp vradopp merged commit 19f410c into main Mar 13, 2024
4 checks passed
@vradopp vradopp deleted the buttonAnalytics branch March 13, 2024 15:51
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.

5 participants