feat(predict): cp-7.65.0 add analytics tracking to deposit flow#25670
feat(predict): cp-7.65.0 add analytics tracking to deposit flow#25670
Conversation
|
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. |
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These are analytics-only changes that don't modify core business logic. The deposit function signature change is backward compatible (optional parameters). All changes are well-covered by updated unit tests. Tag selection rationale:
Performance Test Selection: |



Description
Add analytics event tracking when deposit is triggered from different
entry points (homepage balance, buy preview). The deposit function now
accepts optional analytics parameters including entryPoint and amountUsd.
properties are provided
when balance is insufficient
for deposit, withdraw, and claim
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches the deposit initiation path and changes the
deposithook API to accept parameters, which could break callers or alter deposit triggering behavior if mis-wired; analytics additions are otherwise low impact.Overview
Adds analytics instrumentation to the Predict deposit flow by extending
usePredictDeposit.depositto accept optional{ amountUsd, analyticsProperties }and emittingPredictController.trackPredictOrderEventwithstatus: initiatedandtransactionType: mm_predict_depositwhen provided.Threads the new analytics context through key entry points:
PredictBalancepassesentryPoint: homepage_balancefor the Add Funds button, andusePredictPlaceOrdertriggers a deposit on insufficient BUY balance while passingamountUsd,entryPoint: buy_preview, and market context (merging any existingorderParams.analyticsProperties). Event constants are expanded withBUY_PREVIEWand new transaction type values, and tests are updated/added to assert the new analytics payloads and tracking behavior.Written by Cursor Bugbot for commit d00ac49. This will update automatically on new commits. Configure here.