safe-react
safe-react copied to clipboard
Analytics event over-tracking
Description
A few GA events are being over-tracked and need only track on chain switch/Safe load. They should be moved to their respective mounting component.
Track on chain switch
-
OVERVIEW_EVENTS.ADDED_SAFES_ON_NETWORK
Track on Safe switch
-
ASSETS_EVENTS.DIFFERING_TOKENS
-
ASSETS_EVENTS.NFT_AMOUNT
-
TX_LIST_EVENTS.QUEUED_TXS
Steps to reproduce
By doing the following, duplicate events with the same eventLabel
will be tracked:
- Open the sidebar, close it and reopen it.
- Open balances, navigate away and return to balances.
- Open collectibles, navigate away and return to collectibles.
- Open queue, navigate away and return to queue.
Expected result
Events only track once.
Obtained result
Events track every time.
I don't think memoization is a good solution for this. Tracking should reflect user actions. In the listed examples, the user action that should trigger them is loading a safe. So it should be tracked from the SafeContainer component on mount.
True. They each contain metadata that can change though, e.g. if a Safe was added, a transaction queued, etc. Either way they need track again if the eventLabel
changes.
a transaction queued,
We shouldn't resend that event even if there's plus one tx. This is meant to just gauge how many transactions people have typically in Safes. Tracking it once per session/Safe is more than enough. One more tx won't make a dent.
I've updated the issue accordingly. Please adjust as you see fit.