safe-react icon indicating copy to clipboard operation
safe-react copied to clipboard

Analytics event over-tracking

Open iamacook opened this issue 2 years ago • 4 comments

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.

iamacook avatar Mar 16 '22 13:03 iamacook

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.

katspaugh avatar Mar 16 '22 13:03 katspaugh

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.

iamacook avatar Mar 16 '22 13:03 iamacook

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.

katspaugh avatar Mar 16 '22 13:03 katspaugh

I've updated the issue accordingly. Please adjust as you see fit.

iamacook avatar Mar 16 '22 13:03 iamacook