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

Shopper insights button analytics -- add new params #1187

Merged
merged 16 commits into from
Oct 17, 2024

Conversation

saperi22
Copy link
Contributor

@saperi22 saperi22 commented Oct 14, 2024

Summary of changes

  • Adding new parameters to be tracked for analytics. Addresses: DTMOBILES-1051

Checklist

  • Added a changelog entry
  • Relevant test coverage

Authors

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

@saperi22 saperi22 marked this pull request as ready for review October 15, 2024 19:00
@saperi22 saperi22 requested a review from a team as a code owner October 15, 2024 19:00
Comment on lines 12 to 13
val experiment: String? = null,
val buttonRank: Int? = null
Copy link
Collaborator

Choose a reason for hiding this comment

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

Curious - was there an issue with using delegation or inheritance to not have the base analytics class have module specific properties?

also is there a good way we can document these properties even though it's internal to the SDK?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was there an issue with using delegation or inheritance to not have the base analytics class have module specific properties?

No, I didn't want to do that as part of this ticket. After looking at the way it is setup, I think grouping the events into modules within this AnalyticsEvent class should be sufficient. We use putOpt and only add the relevant parameters to the events, so there isn't extra bloat.
IMO The delegation pattern example you've shared would probably be overly verbose for what we are doing here. If there's a cleaner way and more concise way, I'd prefer that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also is there a good way we can document these properties even though it's internal to the SDK?

I'd think we'd want to break the properties logically into module based properties. Then it'd probably be easier to document them.
Let me address these issues one by one.

Good callouts!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, some of these events are shared by multiple modules. So, there isn't necessarily a proper separation. This is probably the best we'll do on this.

For the documentation though, buttonRank could be module specific, but experiment, though currently limited to one module, could be anything and could be used by any module. Not sure what the best course of action is. I'll probably just keep it as is.

@saperi22
Copy link
Contributor Author

@tdchow I don't want to hold up this PR for the refactor since works and that'd would be considered an improvement. It'll give me time to try a couple different options to figure out which works best. Let me know if you are ok with me moving the refactor to a separate PR.

@tdchow
Copy link
Collaborator

tdchow commented Oct 16, 2024

@tdchow I don't want to hold up this PR for the refactor since works and that'd would be considered an improvement. It'll give me time to try a couple different options to figure out which works best. Let me know if you are ok with me moving the refactor to a separate PR.

I think we can refactor later down the line when the number of analytic params increases. No need to hold up your PR or even continue with the refactor in a follow-up.

However, we still might want to document the new properties somehow. My only worry is that it'll add confusion for new folks who join the team who do not have context on this work.

@@ -2,12 +2,30 @@ package com.braintreepayments.api.core

import androidx.annotation.RestrictTo

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tdchow does this look good?

Copy link
Collaborator

Choose a reason for hiding this comment

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

looks good!

Copy link
Contributor

@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.

Assuming we've verified things look good in FPTI, this looks great to me!

Copy link
Collaborator

@tdchow tdchow left a comment

Choose a reason for hiding this comment

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

Looks great! thanks for adding the docs.

@saperi22 saperi22 merged commit bbcc87e into main Oct 17, 2024
3 checks passed
@saperi22 saperi22 deleted the shopper-insights-button-analytics branch October 17, 2024 18:38
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