Skip to content

chore: update support.metamask urls to track utm source#27331

Merged
saraantole merged 39 commits into
mainfrom
chore/add-utm-param-to-support-website
Apr 17, 2026
Merged

chore: update support.metamask urls to track utm source#27331
saraantole merged 39 commits into
mainfrom
chore/add-utm-param-to-support-website

Conversation

@saraantole
Copy link
Copy Markdown
Contributor

@saraantole saraantole commented Mar 11, 2026

Description

Adds UTM parameters (utm_source=mobile_app) to outbound links in the MetaMask Mobile app, specifically updating the support page link to https://support.metamask.io?utm_source=mobile_app.

Currently all mobile app traffic appears as "Direct" in analytics. This change enables proper attribution to distinguish mobile users from extension users and other sources.

The solution updates link URLs in relevant components (help screens, settings, etc.) while maintaining identical user experience.

Changelog

CHANGELOG entry: Added UTM parameters to mobile app links for improved analytics tracking

Related issues

Manual testing steps

Feature: UTM parameters on support links

  Scenario: Support link contains UTM parameters
    Given MetaMask Mobile app is running on test build
    And user navigates to Settings → Help
    
    When user taps the "Get help" / support link
    Then link URL contains "?utm_source=mobile_app"
    
  Scenario: External browser opens with correct UTM parameters
    Given MetaMask Mobile app is running on test build
    And user navigates to a screen with support link
    
    When user taps support link
    Then external browser opens https://support.metamask.io?utm_source=mobile_app

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.

Note

Medium Risk
Touches many user-facing outbound support links and AppConstants URL wiring; low functional complexity, but mistakes could send users to incorrect help pages or break deep-link constants.

Overview
Adds a MOBILE_UTM suffix and expands app/constants/urls.ts to provide canonical, UTM-tagged MetaMask support/article URLs (plus shared deep-link base constants like MM_UNIVERSAL_LINK_HOST and MM_ANDROID_BUNDLE_ID).

Updates a wide set of screens/modals (Support/Help, onboarding, password reset, staking/earn, perps, ramp region/eligibility, network verification, error boundary, etc.) to stop using hardcoded support URLs and instead reference these centralized constants, with corresponding test expectation updates. Also switches AppConstants to import several URL values and bundle/universal-link constants from constants/urls to avoid duplication.

Reviewed by Cursor Bugbot for commit 6ff5d04. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
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.

@saraantole saraantole added the team-cs Customer Success team label Mar 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Failed
The fixture validation job failed. Review the logs

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 85.24590% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.20%. Comparing base (15470f4) to head (ea34156).
⚠️ Report is 43 commits behind head on main.

Files with missing lines Patch % Lines
.../components/Views/Settings/AppInformation/index.js 0.00% 2 Missing ⚠️
...etworkVerificationInfo/NetworkVerificationInfo.tsx 0.00% 1 Missing ⚠️
...ents/UI/Ramp/Aggregator/components/RegionAlert.tsx 0.00% 1 Missing ⚠️
.../UnsupportedRegionModal/UnsupportedRegionModal.tsx 0.00% 1 Missing ⚠️
...mponents/Settings/LinkedOffDeviceAccountsSheet.tsx 0.00% 0 Missing and 1 partial ⚠️
app/components/Views/AccountsMenu/AccountsMenu.tsx 0.00% 0 Missing and 1 partial ⚠️
app/components/Views/ErrorBoundary/index.js 0.00% 1 Missing ⚠️
...ngs/SecuritySettings/Sections/BlockaidSettings.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #27331    +/-   ##
========================================
  Coverage   82.20%   82.20%            
========================================
  Files        5017     5022     +5     
  Lines      131659   131933   +274     
  Branches    29381    29447    +66     
========================================
+ Hits       108228   108455   +227     
- Misses      16083    16110    +27     
- Partials     7348     7368    +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@saraantole saraantole added skip-e2e skip E2E test jobs labels Mar 11, 2026
@github-actions github-actions Bot added size-L and removed size-M labels Mar 11, 2026
@saraantole saraantole marked this pull request as ready for review March 12, 2026 20:45
@saraantole saraantole requested review from a team as code owners March 12, 2026 20:45
Comment thread .github/ISSUE_TEMPLATE/config.yml Outdated
Comment thread app/core/AppConstants.test.ts Outdated
Comment thread locales/languages/en.json Outdated
@saraantole saraantole requested a review from tommasini March 17, 2026 08:47
@saraantole saraantole force-pushed the chore/add-utm-param-to-support-website branch from 41c4b1c to dd78795 Compare March 18, 2026 09:34
@saraantole saraantole enabled auto-merge March 18, 2026 09:35
@github-actions github-actions Bot added the risk-medium Moderate testing recommended · Possible bug introduction risk label Mar 18, 2026
Comment thread app/components/Views/Settings/AppInformation/index.test.tsx Outdated
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk risk-low Low testing needed · Low bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 18, 2026
Copy link
Copy Markdown
Contributor

@ieow ieow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeWalletPlatform, SmokeRamps, SmokePerps, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR is a URL consolidation/refactoring effort that:

  1. Creates a centralized app/constants/urls.ts with all support URLs, adding ?utm_source=mobile_app UTM parameters to most MetaMask support links
  2. Refactors app/core/AppConstants.ts (critical file) to import from the centralized URLs file instead of having inline strings
  3. Fixes a circular dependency - urls.ts previously imported from AppConstants, now AppConstants imports from urls.ts
  4. Updates ~20+ components to use centralized URL constants instead of hardcoded strings

Nature of changes: Purely URL string consolidation - no functional logic changes. The actual URL paths remain the same; only UTM parameters (?utm_source=mobile_app) are appended to support links.

Components touched and their test coverage:

  • AccountsMenu.tsx → SmokeAccounts, SmokeWalletPlatform (account management)
  • SRPQuiz.tsx, AccountBackupStep1B → SmokeAccounts (SRP flows)
  • ImportPrivateKey, ChoosePassword, ResetPassword, ImportFromSecretRecoveryPhrase → SmokeAccounts, SmokeWalletPlatform (onboarding/account flows)
  • Ramp/RegionAlert, UnsupportedRegionModal, EligibilityFailedModal → SmokeRamps (buy/sell flows)
  • Perps/PerpsTutorialCarousel, perpsConfig.ts → SmokePerps (perps trading)
  • BlockaidSettings.tsx → SmokeConfirmations (security alerts used in confirmations)
  • OptinMetrics → SmokeWalletPlatform (onboarding analytics)
  • NetworkVerificationInfo → SmokeNetworkAbstractions (but covered by SmokeConfirmations for network verification)
  • Stake/constants, Earn/constants/urls.ts, TronStakingLearnMoreModal → SmokeTrade (staking/earn)
  • ErrorBoundary → general app stability
  • AppInformation → SmokeWalletPlatform (settings)

Risk factors:

  • Low risk: URL string changes don't affect app logic or navigation flows
  • The UTM parameter addition (?utm_source=mobile_app) could theoretically affect E2E tests that validate exact URL strings in webview navigation
  • The circular dependency fix is a structural improvement that reduces risk
  • AppConstants.ts is marked critical but the changes are purely refactoring URL strings to use imported constants

Tags NOT selected:

  • SmokeNetworkAbstractions: NetworkVerificationInfo change is minor (URL string only), covered by other tests
  • SmokeNetworkExpansion: No Solana-specific changes
  • SmokeTrade: Staking/earn URL changes are minor; no swap/bridge logic touched
  • SmokeIdentity: No sync/identity logic changes
  • SmokeMultiChainAPI: No multi-chain API changes
  • SmokeSeedlessOnboarding: URL changes in ResetPassword/ChoosePassword are minor string refactors
  • SmokeCard: No card-specific changes
  • SmokePredictions: No predictions changes
  • FlaskBuildTests: No snap-related changes

Performance Test Selection:
This PR only changes URL string constants (adding UTM parameters and centralizing URL definitions). There are no changes to UI rendering, data loading, state management, list components, or app initialization that would impact performance metrics. No performance tests are warranted.

View GitHub Actions results

@amitabh94
Copy link
Copy Markdown
Contributor

Can you please add a small video showing that external links for Ramps still work after this change?

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.75.0 Issue or pull request that will be included in release 7.75.0 risk-low Low testing needed · Low bug introduction risk size-M skip-e2e skip E2E test jobs team-cs Customer Success team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.