Skip to content

chore: add Whats Happening segment events analytics#29803

Merged
zone-live merged 8 commits into
mainfrom
TSA-492-tracking-events-for-whats-happening
May 7, 2026
Merged

chore: add Whats Happening segment events analytics#29803
zone-live merged 8 commits into
mainfrom
TSA-492-tracking-events-for-whats-happening

Conversation

@zone-live
Copy link
Copy Markdown
Contributor

@zone-live zone-live commented May 6, 2026

Description

Wires 5 events for Whats Happening analytics:

Card Scrolled to View, emitted via useViewportTracking in WhatsHappeningCard
Opened — emitted in WhatsHappeningSection on card press and View All
Viewed — emitted in WhatsHappeningDetailView on initial mount and on each carousel scroll
Interaction — emitted in TokenRow
Closed — emitted in WhatsHappeningDetailView on back press

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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
Adds new analytics instrumentation across the Whats Happening homepage section and detail flow, including new component props and scroll/visibility hooks that could subtly affect rendering or event duplication if indices/items drift.

Overview
Adds a full set of MetaMetrics Whats Happening events (new constants in MetaMetrics.events.ts) and wires them through the homepage section and detail experience.

Homepage now tracks WHATS_HAPPENING_OPENED with an entry_point for both card taps and View more, and cards emit WHATS_HAPPENING_CARD_SCROLLED_TO_VIEW via useViewportTracking (introducing a required cardIndex prop).

Detail view now tracks WHATS_HAPPENING_VIEWED once on initial mount and again when the carousel settles on a new index, and tracks WHATS_HAPPENING_CLOSED on back. Token/perps CTAs and source link presses now emit WHATS_HAPPENING_INTERACTION with standardized properties via the new shared helper getWhatsHappeningEventProps (plus interaction_type and asset/source fields).

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

@metamaskbotv2 metamaskbotv2 Bot added the team-social-ai Social & AI team label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

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.

@github-actions github-actions Bot added pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. size-XL labels May 6, 2026
@zone-live zone-live removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 6, 2026
Copy link
Copy Markdown
Contributor

@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.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e8ff318. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR adds analytics instrumentation to the "What's Happening" feature across multiple components:

  1. MetaMetrics.events.ts (CRITICAL): Purely additive — 5 new event names/objects added. No existing events modified. Low risk of breaking existing analytics.

  2. WhatsHappeningSection.tsx / WhatsHappeningCard.tsx: Analytics tracking added for card scroll-to-view and card press. The WhatsHappeningCard now wraps TouchableOpacity in a View with ref and onLayout for viewport tracking — this structural change is minimal but could affect layout in edge cases.

  3. WhatsHappeningDetailView.tsx: Analytics tracking for view, close, and carousel scroll events. Logic changes to handleScrollEnd (index clamping improvement) are also included.

  4. TokenRow.tsx / PerpsRow.tsx: Analytics tracking added to trade/buy button handlers. These connect to swap, perps, and ramp flows.

  5. WhatsHappeningSourcesBottomSheet.tsx: Analytics tracking for source link clicks.

  6. eventProperties.ts / constants.ts: New shared utilities for analytics event properties.

Tag Rationale:

  • SmokeWalletPlatform: WhatsHappening is a section in the Trending/Homepage area. Changes to WhatsHappeningSection, WhatsHappeningCard, and WhatsHappeningDetailView directly affect this feature area.
  • SmokePerps: PerpsRow analytics changes affect the perps trade flow. Per tag description, Perps is a section inside Trending (SmokeWalletPlatform). Changes to PerpsRow views affect Trending.
  • SmokeSwap: TokenRow now wraps trade navigation with analytics tracking. Trade flows connect to swap functionality.
  • SmokeMoney: TokenRow buy button now has analytics tracking connecting to the ramp/buy flow.
  • SmokeConfirmations: Required as a dependent tag when selecting SmokePerps (Add Funds deposits are on-chain transactions), SmokeSwap (transaction confirmations are part of the flow), and SmokeMoney (card/ramp flows that execute swaps).

Performance Impact: Minimal. The useViewportTracking hook and View wrapper in WhatsHappeningCard add a small overhead but not enough to warrant performance tests.

Performance Test Selection:
The changes are primarily analytics instrumentation additions. The only structural change is wrapping WhatsHappeningCard's TouchableOpacity in a View for viewport tracking, which adds minimal overhead. No significant rendering performance impact is expected from these changes. Performance tests are not warranted.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

@zone-live zone-live added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 99e4557 May 7, 2026
104 of 105 checks passed
@zone-live zone-live deleted the TSA-492-tracking-events-for-whats-happening branch May 7, 2026 11:34
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-XL team-social-ai Social & AI team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants