metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

Add more tracking for MetaMask

Open dan437 opened this issue 3 years ago • 4 comments

Explanation

This PR adds some more tracking for MetaMask:

  • App Installed (only if a user opted into metrics)
  • signup_date tracking via traits
  • Support Link Clicked for all links that use the SUPPORT_REQUEST_LINK constant
  • New Wallet Created event after a user clicks on Remind me later (skips seed backup)
  • App Uninstalled via a URL that needs to be implemented first, currently this code is disabled
  • Track Support Link Clicked events also for the SUPPORT_LINK constant

Manual Testing Steps

App Installed and New Wallet Created events

  • Remove the extension
  • In scripts/background.js remove this condition: !(process.env.METAMASK_DEBUG || process.env.IN_TEST) from the browser.runtime.onInstalled listener
  • Run yarn start
  • Install the extension
  • Check the background.html dev tools, specifically the Network tab and search for batch, which shows our tracking requests
  • After you enable metrics, you will see that the App Installed event is tracked
  • Create a new wallet and look for the New Wallet Created event when you click on Remind me later to skip seed backup

Support Link Clicked

  • Open the extension, click on your profile (top right corner)
  • Click on Support, which opens a new tab image
  • Verify that the Support Link Clicked event was tracked if you allowed tracking

dan437 avatar Aug 04 '22 15:08 dan437

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

github-actions[bot] avatar Aug 04 '22 15:08 github-actions[bot]

@worldlyjohn Could you review the schema/format of these events?

brad-decker avatar Aug 04 '22 20:08 brad-decker

aside from moving signup_date from event property to user trait... everything else looks good from a schema POV!

worldlyjohn avatar Aug 04 '22 21:08 worldlyjohn

re-triggered tests cause the unit test failure is a flaky test

brad-decker avatar Aug 05 '22 16:08 brad-decker