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

feat: add account_type/snap_id for buy/send metrics #28011

Merged
merged 13 commits into from
Nov 12, 2024

Conversation

ccharly
Copy link
Contributor

@ccharly ccharly commented Oct 22, 2024

Description

Adds more context/info to the Send/Buy events for both Ethereum and Bitcoin overview screens.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/accounts-planning/issues/636, https://github.com/MetaMask/accounts-planning/issues/637

Manual testing steps

  • Cherry-pick this commit: f938d6d
    • This will allow you to use the verbose mode for the local segment server
  • node development/mock-segment.js -v
  • yarn start:flask
  • Create a Bitcoin account (enable support from the experimental settings)
  • Select a Bitcoin account
  • Click on "Buy" button using your Bitcoin account
  • Click on "Send" button using your Bitcoin account
  • Create an Ethereum account
  • Click on "Buy" button using your Bitcoin account
  • Click on "Send" button using your Bitcoin account

You should see those events from the mock-segment.js server output:

...
[mock-segment]: Events received: Buy Button Clicked {
  "account_type": "bip122:p2wpkh",
  "location": "Home",
  "text": "Buy",
  "chain_id": "bip122:000000000019d6689c085ae165831e93",
  "snap_id": "npm:@metamask/bitcoin-wallet-snap",
  "category": "Navigation",
  "locale": "en",
  "environment_type": "popup"
}
...
[mock-segment]: Events received: Send Button Clicked {
  "account_type": "bip122:p2wpkh",
  "token_symbol": "BTC",
  "location": "Home",
  "text": "Send",
  "chain_id": "bip122:000000000019d6689c085ae165831e93",
  "snap_id": "npm:@metamask/bitcoin-wallet-snap",
  "category": "Navigation",
  "locale": "en",
  "environment_type": "popup"
}
...
[mock-segment]: Events received: Buy Button Clicked {
  "account_type": "eip155:eoa",
  "location": "Home",
  "text": "Buy",
  "chain_id": "0x1",
  "token_symbol": {
    "symbol": "ETH",
    "name": "Ether",
    "address": "0x0000000000000000000000000000000000000000",
    "decimals": 18,
    "iconUrl": "./images/eth_logo.svg",
    "balance": "0",
    "string": "0"
  },
  "category": "Navigation",
  "locale": "en",
  "environment_type": "popup"
}
...
[mock-segment]: Events received: Send Button Clicked {
  "account_type": "eip155:eoa",
  "token_symbol": "ETH",
  "location": "Home",
  "text": "Send",
  "chain_id": "0x1",
  "category": "Navigation",
  "locale": "en",
  "environment_type": "popup"
}
...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@ccharly ccharly self-assigned this Oct 22, 2024
@ccharly ccharly requested a review from a team as a code owner October 22, 2024 15:30
@ccharly ccharly marked this pull request as draft October 22, 2024 15:30
Copy link
Contributor

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.

@ccharly ccharly force-pushed the feat/better-buy-send-account-metrics branch 3 times, most recently from 3bc328d to 7453ec4 Compare October 23, 2024 14:15
@metamaskbot
Copy link
Collaborator

Builds ready [7453ec4]
Page Load Metrics (1944 ± 59 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint22021571877400192
domContentLoaded16952142190612460
load17442159194412359
domInteractive208246189
backgroundConnect1085362010
firstReactRender532051033316
getState565262411
initialActions01000
loadScripts12201605141411254
setupStore1193332612
uiStartup19012424217415675
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 725 Bytes (0.01%)
  • common: 0 Bytes (0.00%)

@ccharly ccharly marked this pull request as ready for review October 23, 2024 15:05
@ccharly ccharly changed the title feat: add account_type/snap_id for buy/send metrics feat: add account_type/snap_id for buy/send metrics Oct 28, 2024
@ccharly ccharly force-pushed the feat/better-buy-send-account-metrics branch from 9909ea6 to 8fcb580 Compare November 8, 2024 14:24
@ccharly ccharly requested a review from kumavis as a code owner November 8, 2024 14:24
@ccharly ccharly force-pushed the feat/better-buy-send-account-metrics branch from 8fcb580 to 86e82ee Compare November 8, 2024 14:36
@ccharly ccharly removed the request for review from kumavis November 8, 2024 14:36
@ccharly ccharly force-pushed the feat/better-buy-send-account-metrics branch from 86e82ee to 1a76031 Compare November 8, 2024 14:38
@ccharly ccharly force-pushed the feat/better-buy-send-account-metrics branch from 91c169c to 0e7dae1 Compare November 8, 2024 15:46
@metamaskbot
Copy link
Collaborator

Builds ready [0e7dae1]
Page Load Metrics (1750 ± 78 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15192129175115977
domContentLoaded14871999171113866
load14962135175016178
domInteractive159247209
backgroundConnect8135373115
firstReactRender45288935024
getState45816157
initialActions01000
loadScripts10511512126112460
setupStore55614168
uiStartup166226241966230110
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 475 Bytes (0.01%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [d890d17]
Page Load Metrics (1850 ± 62 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27720831702470226
domContentLoaded16432062182412560
load16482078185012962
domInteractive15133552814
backgroundConnect8111252311
firstReactRender5511999157
getState55818209
initialActions01000
loadScripts11681577135011455
setupStore56015178
uiStartup18672381206414972
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 475 Bytes (0.01%)
  • common: 0 Bytes (0.00%)

@ccharly ccharly added this pull request to the merge queue Nov 12, 2024
Merged via the queue into develop with commit 2b7101d Nov 12, 2024
76 checks passed
@ccharly ccharly deleted the feat/better-buy-send-account-metrics branch November 12, 2024 12:42
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2024
@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Nov 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.8.0 Issue or pull request that will be included in release 12.8.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants