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

[Event Tracking] Add mixpanel event tracking #94

Closed
lmcmz opened this issue Sep 26, 2024 · 6 comments
Closed

[Event Tracking] Add mixpanel event tracking #94

lmcmz opened this issue Sep 26, 2024 · 6 comments
Assignees

Comments

@lmcmz
Copy link
Contributor

lmcmz commented Sep 26, 2024

https://app.gitbook.com/o/btnrCjBfFA1CijnAHf9d/s/uD5IIQEzBNOcwceEz9qr/

@lmcmz lmcmz moved this to Todo in Flow Wallet Sep 26, 2024
@lmcmz lmcmz changed the title [Event Tracking] Add firebase event tracking [Event Tracking] Add mixpanel event tracking Nov 14, 2024
@lmcmz lmcmz assigned tombeckenham and unassigned zzggo Nov 14, 2024
tombeckenham added a commit that referenced this issue Nov 17, 2024
tombeckenham added a commit that referenced this issue Nov 18, 2024
@tombeckenham
Copy link
Collaborator

tombeckenham commented Nov 18, 2024

List of events and items to do:

  • super_events
  • Identify User
  • script_error
  • delegation_created
  • on_ramp_clicked
  • coa_creation
  • security_tool
  • multi_backup_created
  • multi_backup_creation_failed
  • cadence_transaction_signed
  • evm_transaction_signed
  • ft_transfer
  • nft_transfer
  • Transaction Result
  • account_created
  • account_creation_time (time it takes to create an account)
  • account_recovered

@tombeckenham
Copy link
Collaborator

I've had a look at the Mixpanel documentation to remember how security works and whether we'll have issues with tracking in the chrome extension. In short, yes we will:

  1. The project token is not secret - it can be used and embedded freely and it is not locked to any domain. This is the way Mixpanel was designed. This does mean that anyone can access that project token and use it to send data to our Mixpanel. But why would they... ?
  2. However, mixpanel-browser front end SDK can only be used in the popup. It cannot be called from the service worker. This is because the SDK requires access to the window object - which service workers can't get to. There is no option for service workers besides creating a backend proxy service
  3. If I do move all the tracking to the popup, we'll get issues with ad blockers. Mixpanel's documentation suggests that up to 30% of all events will be lost. With our user base, potentially that number will be higher. I'm wondering, however, if that would be a good thing? It would give our users a way to disable mixpanel tracking if they want to stay anonymous. If we move tracking to the backend, we'd need to create a feature to disable it and include code to disable it

My recommendation is that I implement Mixpanel tracking on the front end.

  • Our users can block tracking using standard means if they want to
  • It's less complicated to implement. I won't have to create a backend, or batch api calls etc
  • It'll give us "some information" quickly

I'm also thinking that maybe we want to put in some sort of transaction analytics that reads the flow blockchain and sends information to mixpanel. That would be a better "backend" way to track what users are doing.

@Peppermint1020 Peppermint1020 moved this from Code Review to Ready for QA in Flow Wallet Nov 29, 2024
@Peppermint1020 Peppermint1020 self-assigned this Nov 29, 2024
tombeckenham added a commit that referenced this issue Nov 29, 2024
tombeckenham added a commit that referenced this issue Nov 29, 2024
tombeckenham added a commit that referenced this issue Nov 29, 2024
tombeckenham added a commit that referenced this issue Nov 29, 2024
@Peppermint1020
Copy link
Contributor

List of events and items to do:

  • super_events
  • Identify User
  • script_error
  • delegation_created
  • on_ramp_clicked
  • coa_creation
  • security_tool: not applied on extension
  • multi_backup_created: not applied on extension
  • multi_backup_creation_failed: not applied on extension
  • cadence_transaction_signed
  • evm_transaction_signed
  • ft_transfer
  • nft_transfer
  • Transaction Result
  • account_created
  • account_creation_time (time it takes to create an account)
  • account_recovered

@Peppermint1020 Peppermint1020 moved this from Ready for QA to In QA in Flow Wallet Dec 3, 2024
@lmcmz lmcmz closed this as completed in 49edb71 Dec 6, 2024
@Peppermint1020
Copy link
Contributor

Tested on https://github.com/Outblock/FRW-Extension/actions/runs/12092593566
(1) All event names are currently displayed as "page view"; they should display the event names from the GitBook events.
Image
Expectation behaviour is:
Image

(2)We have Production Mixpanel project Id. Please spilt our DEV and Production ENV accordingly.

@Peppermint1020 Peppermint1020 reopened this Dec 9, 2024
@Peppermint1020 Peppermint1020 moved this from In QA to In Progress in Flow Wallet Dec 9, 2024
@tombeckenham tombeckenham moved this from In Progress to Code Review in Flow Wallet Dec 16, 2024
@Peppermint1020
Copy link
Contributor

Peppermint1020 commented Dec 16, 2024

@tombeckenham
Please check following issues.
Tested on https://github.com/Outblock/FRW-Extension/actions/runs/12345848657

  • super_events
Image We need include following keys for all events Image
  • Identify User
Image
  • script_error:This event has not been triggered as not meet script error.
  • delegation_created
Image
  • on_ramp_clicked
Image Image The value of type is type of FT send and ft_identifier should in following format Image
  • nft_transfer
Image The nft_identifier should in following format. Image
  • Transaction Result
    This event has not been triggered.
  • account_created
Image We miss key_type. Image
  • account_creation_time (time it takes to create an account)
    This event has not been triggered
  • account_recovered
    The "method" field is empty.
Image

@tombeckenham tombeckenham moved this from Code Review to In QA in Flow Wallet Dec 17, 2024
@Peppermint1020
Copy link
Contributor

Confirm with Tom.
The issue is the MixPanel transaction tracking code is repeated across dozens of components that we are planning to refactor.
We decide to go with what we have with MixPanel then update it later

@Peppermint1020 Peppermint1020 moved this from In QA to Done in Flow Wallet Dec 22, 2024
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

No branches or pull requests

4 participants