-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: Add all entry points for Predict feed #22659
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
Conversation
- Pass origin parameter through deeplink handler chain - Use origin value directly as entryPoint (carousel, notification, etc.) - Default to 'deeplink' when origin is undefined - Update PredictEventValues to use CAROUSEL instead of BANNER - Add comprehensive tests for origin parameter handling - All navigations now include entryPoint for accurate analytics tracking
…ion paths - Add new entry point constants: REWARDS, GTM_MODAL - Track entry points for all Predict feed navigations: - homepage_positions: Explore from empty positions - homepage_new_prediction: New prediction button - homepage_balance: Balance card touch - main_trade_button: Wallet actions & trade button - rewards: Rewards ways to earn CTA - gtm_modal: What's new modal engagement - Replace hardcoded strings with type-safe constants - Update all navigation calls to include entryPoint params - Update all tests to expect entry point parameters - All 36 tests passing
…aMask - Add CREATED_POLYMARKET_ACCOUNT_VIA_MM user profile property - Set trait when deployment transaction is included in deposit preparation - Trait is automatically attached to all future analytics events - Non-blocking: errors in trait setting don't affect deposit flow - Enables cohort analysis and funnel tracking for Polymarket adoption
- Update all Predict deeplink test assertions to expect origin parameter - All 4 Predict action tests now pass with correct parameter expectations - Tests verify origin is properly passed from universal link to deeplink handler - All 55 tests passing
- Include entryPoint parameter in handleMarketNavigation fallback when no market ID provided - Ensures consistent analytics tracking for all deeplink navigation paths - All 30 tests passing
- Create private setPolymarketAccountCreatedTrait() method - Use .catch() for proper async error handling (fire-and-forget pattern) - Clean separation of concerns with descriptive method name - Non-blocking trait setting with error logging to Sentry - All 169 tests passing
…thub.com/MetaMask/metamask-mobile into feature/predict/add-carousel-entry-point
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsFallback: AI analysis did not complete successfully. Running all tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Predict Button: Network Compatibility Issue
The Predict button is missing the isEvmSelected check that exists in TradeWalletActions.tsx and is used for the Perps button in the same file. Predict only works on EVM networks (Polygon), so the button will incorrectly appear on non-EVM networks, leading to navigation to a non-functional feature. The condition should be isPredictEnabled && isEvmSelected to match the pattern used elsewhere.
app/components/Views/WalletActions/WalletActions.tsx#L204-L213
metamask-mobile/app/components/Views/WalletActions/WalletActions.tsx
Lines 204 to 213 in 7588b78
| {isPredictEnabled && ( | |
| <ActionListItem | |
| label={strings('asset_overview.predict_button')} | |
| description={strings('asset_overview.predict_description')} | |
| iconName={IconName.Speedometer} | |
| onPress={onPredict} | |
| testID={WalletActionsBottomSheetSelectorsIDs.PREDICT_BUTTON} | |
| isDisabled={!canSignTransactions} | |
| /> |
|



Predict: Entry Point Tracking & User Trait Implementation
Overview
This PR implements comprehensive entry point tracking for the Predict feature and adds a persistent user trait for Polymarket account creation. These changes enable better analytics attribution and user segmentation across all Predict interactions.
CHANGELOG entry: null
Changes
1. User Trait for Polymarket Account Creation
Added persistent user trait to track Polymarket account creation via MetaMask:
CREATED_POLYMARKET_ACCOUNT_VIA_MMbooleanPolymarketProvider.prepareDeposit()when deployment transaction is includedBenefits:
Files Changed:
app/util/metrics/UserSettingsAnalyticsMetaData/UserProfileAnalyticsMetaData.types.tsapp/components/UI/Predict/providers/polymarket/PolymarketProvider.ts2. Deeplink Origin Parameter Handling
Fixed deeplink manager to correctly pass
originparameter to Predict navigation:carouselentry pointoriginthrough entire chain and map directly toentryPointorigin === 'carousel'→entryPoint: 'carousel', otherwise →entryPoint: 'deeplink'Files Changed:
app/core/DeeplinkManager/DeeplinkManager.tsapp/core/DeeplinkManager/ParseManager/handleUniversalLink.tsapp/core/DeeplinkManager/Handlers/handlePredictUrl.ts3. Comprehensive Entry Point Tracking
Added missing
entryPointparameters across all Predict navigation paths:New Entry Point Constants
Navigation Paths Updated
PredictPositionsHeaderhomepage_balancePredictPositionEmptyhomepage_positionsPredictNewButtonhomepage_new_predictionPredictGTMModalgtm_modalTradeWalletActionsmain_trade_buttonWalletActionsmain_trade_buttonWaysToEarn(Rewards)rewardsPredictionSectionhomepage_new_predictionFiles Changed:
app/components/UI/Predict/constants/eventNames.tsapp/components/UI/Predict/components/PredictPositionsHeader/PredictPositionsHeader.tsxapp/components/UI/Predict/components/PredictPositionEmpty/PredictPositionEmpty.tsxapp/components/UI/Predict/components/PredictNewButton/PredictNewButton.tsxapp/components/UI/Predict/components/PredictGTMModal/PredictGTMModal.tsxapp/components/Views/TradeWalletActions/TradeWalletActions.tsxapp/components/Views/WalletActions/WalletActions.tsxapp/components/UI/Rewards/components/Tabs/OverviewTab/WaysToEarn/WaysToEarn.tsxapp/components/Views/TrendingView/PredictionSection/PredictionSection.tsx4. Test Updates
Updated all tests to expect
entryPointparameters:handleUniversalLink.test.tsto expectoriginparameter in_handlePredictcallsentryPointin navigation assertionsexpect.any(String)for flexibility while ensuring parameter presenceTest Files Changed:
app/core/DeeplinkManager/ParseManager/handleUniversalLink.test.tsapp/core/DeeplinkManager/Handlers/handlePredictUrl.test.tsapp/components/UI/Predict/components/PredictPositionsHeader/PredictPositionsHeader.test.tsxapp/components/UI/Predict/components/PredictPositionEmpty/PredictPositionEmpty.test.tsxapp/components/UI/Predict/components/PredictNewButton/PredictNewButton.test.tsxapp/components/UI/Predict/components/PredictGTMModal/PredictGTMModal.test.tsxapp/components/Views/TradeWalletActions/TradeWalletActions.test.tsxapp/components/Views/WalletActions/WalletActions.test.tsxapp/components/UI/Rewards/components/Tabs/OverviewTab/WaysToEarn/WaysToEarn.test.tsxapp/components/Views/TrendingView/PredictionSection/PredictionSection.test.tsxAnalytics Impact
Entry Point Coverage
All user journeys to Predict now include proper
entry_pointattribution:User Trait Usage
The
created_polymarket_account_via_mmtrait will be automatically included in:Testing
Unit Tests
Manual Testing
entryPoint: 'carousel'in analyticsentryPoint: 'homepage_balance'entryPoint: 'main_trade_button'entryPoint: 'rewards'created_polymarket_account_via_mm: truein subsequent eventsMigration Notes
No Breaking Changes
Analytics Team Action Items
created_polymarket_account_via_mmappears in SegmentRelated Documentation
segment-schemarepo for Predict event schemasapp/components/UI/Predict/constants/eventNames.tsapp/util/metrics/UserSettingsAnalyticsMetaData/UserProfileAnalyticsMetaData.types.tsChecklist
Note
Adds consistent
entryPointanalytics to all Predict navigations and deeplinks, and sets a persistent user trait when a Polymarket account is created via MetaMask.ENTRY_POINTvalues (e.g.,carousel,rewards,gtm_modal) inconstants/eventNames.tsand passparams.entryPointon navigations fromPredictGTMModal,PredictNewButton,PredictPositionEmpty,PredictPositionsHeader,TradeWalletActions,WalletActions, and RewardsWaysToEarnCTA toRoutes.PREDICT.MARKET_LIST.originto Predict handler viaDeeplinkManagerandhandleUniversalLink; maporigin->params.entryPointinhandlePredictUrl(defaults todeeplink) for both market details and list routes; enhance logging.UserProfileProperty.CREATED_POLYMARKET_ACCOUNT_VIA_MMand set it inPolymarketProvider.prepareDeposit()when deploying proxy wallet (fire-and-forget with error logging).params.entryPointandoriginpropagation across components and deeplink handlers.Written by Cursor Bugbot for commit 7588b78. This will update automatically on new commits. Configure here.