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

[Metrics] dApps metrics #16912

Closed
alexjba opened this issue Dec 6, 2024 · 0 comments · Fixed by #16962
Closed

[Metrics] dApps metrics #16912

alexjba opened this issue Dec 6, 2024 · 0 comments · Fixed by #16962

Comments

@alexjba
Copy link
Contributor

alexjba commented Dec 6, 2024

Description

Summary: As a core contributor
I want to know how the users are using the dApps integration
So that I can plan future features
And to help users by fixing problematic flows

Metrics

https://www.notion.so/Event-Tracking-Specification-Desktop-1518f96fb65c8026a3a5c8a0459f7f21?pvs=4#63de5b7c3b6c4a7cab492cff6aa95957

https://www.notion.so/Metrics-for-Wallet-Connect-d3d1e60e7ea24479bd35cbb11219540c?pvs=4

Board example

https://eu.mixpanel.com/s/3kYRpk

Acceptance criteria

Given the WalletConnect sdk fails to load
Then the `dapps-health` event is sent with `state=wc_unavailable`
Given the WalletConnect sdk loads successfully
Then the `dapps-health` event is sent with `state=wc_available`
Given all chains connections are down
Then the `dapps-health` event is sent with `state=chains_down`
Given the network is down
Then the `dapps-health` event is sent with `state=network_down`
Given the WalletConnect pairing fails
Then the `dapps-health` event is sent with `state=pair_error`
And `error` with a string description
Given the connection fails
Then the `dapps-health` event is sent with `state=connection_error`
And `error` with a string description
Given the sign or transaction fails
Then the `dapps-health` event is sent with `state=sign_error`
And `error` with a string description
Given the dApps button is clicked
And the dapps combo box opens
Then the `dapps-navigation` event is sent with `flow=dapps_list_opened`
Given the dApps comboBox opens
And the `Connect` button is clicked
Then the `dapps-navigation` event is sent with `flow=connect_initiated`
Given the dApps comboBox opens
And the `Disconnect` button is clicked on a dApp
Then the `dapps-navigation` event is sent with `flow=disconnect_initiated`
Given the connect modal is open
And `WalletConnect` is clicked
Then the `dapps-navigation` event is sent with `flow=pair_initiated`
And `connector=wallet_connect`
Given the connect modal is open
And `StatusConnect` is clicked
Then the `dapps-navigation` event is sent with `flow=pair_initiated`
And `connector=browser_connect`
Given a wallet connect proposal is received
Then the `dapps-connection` event is sent and the following properties are filled
`flow=proposal_received`
`networks` - list of proposed networks (both optional and required)
`methods` - list of proposed methods (both optional and required)
`dapp` - dapp url
`connector` - wallet_connect
`isSiwe` - undefined
Given a dapp proposal is accepted
Then the `dapps-connection` event is sent and the followind properties are filled
`flow=proposal_accepted
`networks` - list of accepted networks
`dapp` - dapp url
`connector` - `wallet_connect` or `browser_connect`
Given a dapp proposal is rejected
Then the `dapps-connection` event is sent and the following properties are filled
`flow=proposal_rejected`
`dapp` - dapp url
`connector` - `wallet_connect` or `browser_connect`
Given a new connection is establihed
Then the `dapps-connection` event is sent and the following properties are filled
`flow=connected`
`dapp` - dapp url
`connector` - `wallet_connect` or `browser_connect`
Given a dapp has been disconnected
Then the `dapps-connection` event is sent and the following properties are filled
`flow=disconnected`
`dapp` - dapp url
`connector` - `wallet_connect` or `browser_connect`
Given a new sign/transaction request is received
Then a new `dapps-sign` event is sent and the following properties are filled
`flow=sign_received`
`connector` - `wallet_connect` or `browser_connect`
`method` - signing method
`chainId` - chain id
`dapp` - dapp url
Given a sign/transaction request is accepted
Then a new `dapps-sign` event is sent and the following properties are filled
`flow=sign_accepted`
`connector` - `wallet_connect` or `browser_connect`
`method` - signing method
`chainId` - chain id
`dapp` - dapp url
Given a sign/transaction request is rejected
Then a new `dapps-sign` event is sent and the following properties are filled
`flow=sign_rejected`
`connector` - `wallet_connect` or `browser_connect`
`method` - signing method
`chainId` - chain id
`dapp` - dapp url
@alexjba alexjba added this to the 2.33.0 Beta milestone Dec 6, 2024
@alexjba alexjba self-assigned this Dec 6, 2024
alexjba added a commit that referenced this issue Dec 13, 2024
closes #16912

Sending the dapps events to mixpanel

| Event Name | Properties | Possible Values | Notes |
| --- | --- | --- | --- |
| dapps-health | state | - wc_available
- wc_unavailable
- chains_down
- network_down
- pair_error
- connection_error
- sign_error |  |
|  | error |  | string description |
| dapps-navigation | flow | - dapps_list_opened
- connect_initiated
- disconnect_initiated
- pair_initiated |  |
|  | connector | - wallet_connect
- browser_connect |  |
| dapps-connection | flow | - proposal_received
- proposal_accepted
- proposal_rejected
- connected
- disconnected |  |
|  | networks | networks[string] - array of networks | Array of proposed or connected networks |
|  | methods | methods[string] - array of methods | Array of proposed methods |
|  | dapp | dapp uri |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | isSiwe | boolean |  |
| dapps-sign | flow | - sign_received
- sign_accepted
- sign_rejected |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | method | - personal_sign
- eth_sign
- eth_signTypedData_v4
- eth_signTypedData
- eth_signTransaction
- eth_sendTransaction |  |
|  | dapp | string - dapp uri |  |
|  | chainId | int - chain id |  |
alexjba added a commit that referenced this issue Dec 13, 2024
closes #16912

Sending the dapps events to mixpanel

| Event Name | Properties | Possible Values | Notes |
| --- | --- | --- | --- |
| dapps-health | state | - wc_available
- wc_unavailable
- chains_down
- network_down
- pair_error
- connection_error
- sign_error |  |
|  | error |  | string description |
| dapps-navigation | flow | - dapps_list_opened
- connect_initiated
- disconnect_initiated
- pair_initiated |  |
|  | connector | - wallet_connect
- browser_connect |  |
| dapps-connection | flow | - proposal_received
- proposal_accepted
- proposal_rejected
- connected
- disconnected |  |
|  | networks | networks[string] - array of networks | Array of proposed or connected networks |
|  | methods | methods[string] - array of methods | Array of proposed methods |
|  | dapp | dapp uri |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | isSiwe | boolean |  |
| dapps-sign | flow | - sign_received
- sign_accepted
- sign_rejected |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | method | - personal_sign
- eth_sign
- eth_signTypedData_v4
- eth_signTypedData
- eth_signTransaction
- eth_sendTransaction |  |
|  | dapp | string - dapp uri |  |
|  | chainId | int - chain id |  |
@alexjba alexjba moved this to In Progress in Status Desktop/Mobile Board Dec 13, 2024
alexjba added a commit that referenced this issue Jan 10, 2025
closes #16912

Sending the dapps events to mixpanel

| Event Name | Properties | Possible Values | Notes |
| --- | --- | --- | --- |
| dapps-health | state | - wc_available
- wc_unavailable
- chains_down
- network_down
- pair_error
- connection_error
- sign_error |  |
|  | error |  | string description |
| dapps-navigation | flow | - dapps_list_opened
- connect_initiated
- disconnect_initiated
- pair_initiated |  |
|  | connector | - wallet_connect
- browser_connect |  |
| dapps-connection | flow | - proposal_received
- proposal_accepted
- proposal_rejected
- connected
- disconnected |  |
|  | networks | networks[string] - array of networks | Array of proposed or connected networks |
|  | methods | methods[string] - array of methods | Array of proposed methods |
|  | dapp | dapp uri |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | isSiwe | boolean |  |
| dapps-sign | flow | - sign_received
- sign_accepted
- sign_rejected |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | method | - personal_sign
- eth_sign
- eth_signTypedData_v4
- eth_signTypedData
- eth_signTransaction
- eth_sendTransaction |  |
|  | dapp | string - dapp uri |  |
|  | chainId | int - chain id |  |
alexjba added a commit that referenced this issue Jan 20, 2025
closes #16912

Sending the dapps events to mixpanel

| Event Name | Properties | Possible Values | Notes |
| --- | --- | --- | --- |
| dapps-health | state | - wc_available
- wc_unavailable
- chains_down
- network_down
- pair_error
- connection_error
- sign_error |  |
|  | error |  | string description |
| dapps-navigation | flow | - dapps_list_opened
- connect_initiated
- disconnect_initiated
- pair_initiated |  |
|  | connector | - wallet_connect
- browser_connect |  |
| dapps-connection | flow | - proposal_received
- proposal_accepted
- proposal_rejected
- connected
- disconnected |  |
|  | networks | networks[string] - array of networks | Array of proposed or connected networks |
|  | methods | methods[string] - array of methods | Array of proposed methods |
|  | dapp | dapp uri |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | isSiwe | boolean |  |
| dapps-sign | flow | - sign_received
- sign_accepted
- sign_rejected |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | method | - personal_sign
- eth_sign
- eth_signTypedData_v4
- eth_signTypedData
- eth_signTransaction
- eth_sendTransaction |  |
|  | dapp | string - dapp uri |  |
|  | chainId | int - chain id |  |
alexjba added a commit that referenced this issue Jan 20, 2025
closes #16912

Sending the dapps events to mixpanel

| Event Name | Properties | Possible Values | Notes |
| --- | --- | --- | --- |
| dapps-health | state | - wc_available
- wc_unavailable
- chains_down
- network_down
- pair_error
- connection_error
- sign_error |  |
|  | error |  | string description |
| dapps-navigation | flow | - dapps_list_opened
- connect_initiated
- disconnect_initiated
- pair_initiated |  |
|  | connector | - wallet_connect
- browser_connect |  |
| dapps-connection | flow | - proposal_received
- proposal_accepted
- proposal_rejected
- connected
- disconnected |  |
|  | networks | networks[string] - array of networks | Array of proposed or connected networks |
|  | methods | methods[string] - array of methods | Array of proposed methods |
|  | dapp | dapp uri |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | isSiwe | boolean |  |
| dapps-sign | flow | - sign_received
- sign_accepted
- sign_rejected |  |
|  | connector | - wallet_connect
- browser_connect |  |
|  | method | - personal_sign
- eth_sign
- eth_signTypedData_v4
- eth_signTypedData
- eth_signTransaction
- eth_sendTransaction |  |
|  | dapp | string - dapp uri |  |
|  | chainId | int - chain id |  |
@github-project-automation github-project-automation bot moved this from In Progress to Done in Status Desktop/Mobile Board Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant