Skip to content

chore(runway): cherry-pick feat(predict): cp-7.63.0 add game properties to analytics events#25123

Merged
joaoloureirop merged 1 commit intorelease/7.63.0from
runway-cherry-pick-7.63.0-1769190389
Jan 23, 2026
Merged

chore(runway): cherry-pick feat(predict): cp-7.63.0 add game properties to analytics events#25123
joaoloureirop merged 1 commit intorelease/7.63.0from
runway-cherry-pick-7.63.0-1769190389

Conversation

@runway-github
Copy link
Copy Markdown
Contributor

@runway-github runway-github bot commented Jan 23, 2026

Description

Add new analytics properties to Predict market events to improve
tracking for sports/game-based prediction markets:

  1. PREDICT_MARKET_DETAILS_OPENED and PREDICT_TRADE_TRANSACTION
    events now include:

    • market_slug - Market slug identifier
    • game_id - Game identifier
    • game_start_time - Game start timestamp
    • game_league - League name (e.g., "NBA", "NFL")
    • game_status - Game status (e.g., "not_started", "live", "final")
    • game_period - Current game period (nullable)
    • game_clock - Current game clock (nullable)
  2. SHARE_ACTION event tracking added for share button interactions:

    • status - Share status: "initiated", "success", or "failed"
    • market_id - Market identifier
    • market_slug - Market slug

These changes align with the Segment schema updates in segment-schema
PR #429
.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: Predict Analytics Events

  Scenario: Game properties sent on market details view
    Given user navigates to a sports prediction market
    When user opens the market details view
    Then PREDICT_MARKET_DETAILS_OPENED event includes game properties (game_id, game_league, game_status, etc.)

  Scenario: Game properties sent on trade transaction
    Given user is on a sports prediction market buy/sell preview
    When user completes a buy or sell transaction
    Then PREDICT_TRADE_TRANSACTION event includes game properties

  Scenario: Share action tracking
    Given user is viewing a prediction market with game details
    When user taps the share button
    Then SHARE_ACTION event is sent with status "initiated"
    And when share completes successfully, SHARE_ACTION event is sent with status "success"
    And when share fails, SHARE_ACTION event is sent with status "failed"

Screenshots/Recordings

N/A - Analytics only change, no UI modifications

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

Enhances Predict analytics coverage for sports markets and sharing flows.

  • Adds market_slug, game_id, game_start_time, game_league, game_status, game_period, game_clock to PREDICT_TRADE_TRANSACTION and PREDICT_MARKET_DETAILS_OPENED via PredictController, with type updates in providers/types.ts
  • Introduces PredictShareStatus and new SHARE_ACTION tracking in PredictController.trackShareAction
  • Updates PredictShareButton to send SHARE_ACTION events on press (initiated) and on result (success/failed), and accept/pass marketSlug; propagates prop from market detail/game views
  • Adds comprehensive tests for share URL, toasts, edge cases, and analytics status flows

Written by Cursor Bugbot for commit 7040a85. This will update automatically on new commits. Configure here.

a2d49c6

…es to analytics events (#25065)

## **Description**

Add new analytics properties to Predict market events to improve
tracking for sports/game-based prediction markets:

1. **PREDICT_MARKET_DETAILS_OPENED** and **PREDICT_TRADE_TRANSACTION**
events now include:
   - `market_slug` - Market slug identifier
   - `game_id` - Game identifier
   - `game_start_time` - Game start timestamp
   - `game_league` - League name (e.g., "NBA", "NFL")
   - `game_status` - Game status (e.g., "not_started", "live", "final")
   - `game_period` - Current game period (nullable)
   - `game_clock` - Current game clock (nullable)

2. **SHARE_ACTION** event tracking added for share button interactions:
   - `status` - Share status: "initiated", "success", or "failed"
   - `market_id` - Market identifier
   - `market_slug` - Market slug

These changes align with the Segment schema updates in [segment-schema
PR #429](Consensys/segment-schema#429).

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes: 
 - https://consensyssoftware.atlassian.net/browse/PRED-422
 - https://consensyssoftware.atlassian.net/browse/PRED-505

## **Manual testing steps**

```gherkin
Feature: Predict Analytics Events

  Scenario: Game properties sent on market details view
    Given user navigates to a sports prediction market
    When user opens the market details view
    Then PREDICT_MARKET_DETAILS_OPENED event includes game properties (game_id, game_league, game_status, etc.)

  Scenario: Game properties sent on trade transaction
    Given user is on a sports prediction market buy/sell preview
    When user completes a buy or sell transaction
    Then PREDICT_TRADE_TRANSACTION event includes game properties

  Scenario: Share action tracking
    Given user is viewing a prediction market with game details
    When user taps the share button
    Then SHARE_ACTION event is sent with status "initiated"
    And when share completes successfully, SHARE_ACTION event is sent with status "success"
    And when share fails, SHARE_ACTION event is sent with status "failed"
```

## **Screenshots/Recordings**

N/A - Analytics only change, no UI modifications

## **Pre-merge author checklist**

- [x] 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).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Enhances Predict analytics coverage for sports markets and share
interactions.
> 
> - Extends `PREDICT_TRADE_TRANSACTION` and
`PREDICT_MARKET_DETAILS_OPENED` with `market_slug`, `game_id`,
`game_start_time`, `game_league`, `game_status`, `game_period`,
`game_clock`
> - Adds `PredictController.trackShareAction` and wires
`PredictShareButton` to track `initiated` → `success`/`failed` (includes
`market_id` and optional `market_slug`)
> - Passes `marketSlug` into `PredictShareButton` in market/game detail
views
> - Updates analytics types/interfaces to carry new fields across
controller/provider layers
> - Adds unit tests for share button analytics, URL/message
construction, and edge cases
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4c8b0b8. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@runway-github runway-github bot requested a review from a team as a code owner January 23, 2026 17:46
@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.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Jan 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.63.0)

All E2E tests pre-selected.

View GitHub Actions results

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

} else if (result.action === Share.dismissedAction) {
// Dismissed
} else {
throw new Error('Failed to share');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Share dismissal incorrectly tracked as failure

Medium Severity

When a user intentionally dismisses the share dialog (cancels without sharing), the code now throws an error and tracks it as PredictShareStatus.FAILED. The original code specifically handled Share.dismissedAction separately from failures, treating it as a normal user action requiring no tracking. User cancellation is semantically different from an actual failure—this conflates intentional user behavior with system errors, causing inflated failure rates in analytics. Additionally, on Android Share.share() always returns sharedAction (platform limitation), so dismissals there would track as SUCCESS, creating cross-platform inconsistency.

Fix in Cursor Fix in Web

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
8.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@joaoloureirop joaoloureirop added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jan 23, 2026
@joaoloureirop joaoloureirop merged commit d82b7aa into release/7.63.0 Jan 23, 2026
176 of 179 checks passed
@joaoloureirop joaoloureirop deleted the runway-cherry-pick-7.63.0-1769190389 branch January 23, 2026 18:51
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 26, 2026
@metamaskbot
Copy link
Copy Markdown
Collaborator

No release label on PR. Adding release label release-7.63.0 on PR, as PR was cherry-picked in branch 7.63.0.

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

Labels

release-7.63.0 Issue or pull request that will be included in release 7.63.0 size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants