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

fix: Track transaction item open events #2602

Merged
merged 3 commits into from
Oct 12, 2023
Merged

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented Oct 9, 2023

What it solves

Fix for #2543

This will significantly reduce the number of events that are tracked due to users opening a single transaction view (which is already tracked by a page view event).

How this PR fixes it

  • Removes Fetch transaction details event
  • Tracks Expand transaction item event whenever the user expands a transaction item

How to test it

  1. Open a transaction history
  2. Click on a transaction to expand
  3. Observe that the event is tracked
  4. Close the transaction and open it again
  5. Observe that the event is tracked again
  6. Open a single transaction view
  7. Observe that no event for fetch tx details is tracked

@usame-algan usame-algan requested a review from katspaugh October 9, 2023 06:56
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Branch preview

✅ Deploy successful!

https://fetch_details_event--walletweb.review-wallet-web.5afe.dev

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@@ -126,7 +126,9 @@ const TxDetails = ({

const [txDetailsData, error, loading] = useAsync<TransactionDetails>(
async () => {
trackEvent(TX_LIST_EVENTS.FETCH_DETAILS)
if (!txDetails) {
Copy link
Member

Choose a reason for hiding this comment

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

That's a negation, isn't it? Why do we even track this event? We should track clicks on the accordeon, not the fetch.

Copy link
Member Author

Choose a reason for hiding this comment

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

I also considered tracking this event on the accordion click but with the current structure it doesn't seem possible since the fetch is in a nested component and with the accordion click we can only know if it was opened or closed but not if we already fetched the data before. Do you think we should track the first accordion open in general regardless of the fetch status?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. I think we should track the user intention, not how our app interpreted it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it so we track the accordion open once. I also renamed the event to better fit the new purpose.

@usame-algan usame-algan requested a review from katspaugh October 9, 2023 10:26
@usame-algan usame-algan changed the title fix: Only track fetch details event if tx details are fetched fix: Track transaction item open events Oct 9, 2023
@francovenica
Copy link
Contributor

Ok so I did't understand at first since I don't remember at heart what events we track with those actions, so I'll leave this comment here for the sake of documentation on "how it was" vs "how it is right now"

This event used to track whenever you expand a tx item and it would only track once. Also the same event tracks whenever you open a tx in the individual view with its deep link.
image

I've checked now that a different event is tracked when the tx is expanded and no "Fetch" event is tracked when expanding a tx item nor when it is opened with a deep link
image
image

Looks good to me

@usame-algan usame-algan merged commit e43d777 into dev Oct 12, 2023
9 checks passed
@usame-algan usame-algan deleted the fetch-details-event branch October 12, 2023 14:20
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants