You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(snaps): Add integration for new RPC method snap_trackEvent (#15209)
## **Description**
Add integration for new RPC method: `snap_trackEvent`
SIP-32: https://metamask.github.io/SIPs/SIPS/sip-32
Related PRs:
- Snaps: MetaMask/snaps#3375
- Extension: MetaMask/metamask-extension#32554
## **Related issues**
MetaMask/snaps#3274
## **Manual testing steps**
1. Within some of the preinstalled Snaps use `snap_trackEvent` RPC
method and send some tracking data in format specified in
[SIP-32](https://metamask.github.io/SIPs/SIPS/sip-32).
2. Find a way and verify that the event is sent (intercept MetaMetrics
track event method or check with other e2e metrics testing utilities)
Example Snap code used for testing the method:
```typescript
await snap.request({
method: 'snap_trackEvent',
params: {
event: {
event: 'SnapExportUsed',
properties: {
export: 'onRpcRequest',
origin: 'https://metamask.io',
snap_category: null,
snap_id: 'npm:@metamask/example-snap',
success: true,
},
sensitiveProperties: {
transaction_hash: 'transaction-hash',
},
},
},
});
```
## **Screenshots/Recordings**
### **Before**
n/a
### **After**
n/a
## **Pre-merge author checklist**
- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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.
0 commit comments