Skip to content
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

feat: add metametrics events to carousel #29141

Merged
merged 7 commits into from
Dec 19, 2024
Merged

feat: add metametrics events to carousel #29141

merged 7 commits into from
Dec 19, 2024

Conversation

jonybur
Copy link
Contributor

@jonybur jonybur commented Dec 12, 2024

Description

This PR introduces tracking metrics for banners in the carousel to monitor their effectiveness. The following events are added:

  • Banner selected: Triggered when a banner or a button within a banner is clicked.
  • Close all banners: Triggered when the last banner in the carousel is closed.
  • Banner shown: Triggered when a banner is displayed in the carousel.

Tracking Implementation Details:

Banner selected

When a banner or button in a banner is clicked:

trackEvent({
          event: MetaMetricsEventName.BannerSelect,
          category: MetaMetricsEventCategory.Banner,
          properties: {
            banner_name: e.g. buy, bridge, sell, card
          }
});

Close all banners

When the last banner in the carousel is closed:

trackEvent({
          event: MetaMetricsEventName.BannerCloseAll,
          category: MetaMetricsEventCategory.Banner
});

Banner shown

When a banner is displayed in the carousel:

trackEvent({
          event: MetaMetricsEventName.BannerDisplay,
          category: MetaMetricsEventCategory.Banner,
          properties: {
            banner_name: e.g. buy, bridge, sell, card
          }
});

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3764

Manual testing steps

  1. Open the carousel.
  2. Click on banners or buttons within banners to trigger the "Banner selected" event.
  3. Close the last banner to trigger the "Close all banners" event.
  4. Navigate through the carousel to ensure the "Banner shown" event is fired for each displayed banner.

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.

@jonybur jonybur requested a review from a team as a code owner December 12, 2024 14:15
Copy link
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.

@jonybur jonybur changed the title feat: add metametrics events feat: add metametrics events to carousel Dec 12, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [993b969]
Page Load Metrics (1916 ± 80 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31822551703563270
domContentLoaded16712239188216479
load16782265191616780
domInteractive269849189
backgroundConnect896362512
firstReactRender1777402110
getState575232110
initialActions01000
loadScripts12391673141812761
setupStore86020189
uiStartup19312586218118086
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 849 Bytes (0.01%)
  • common: 118 Bytes (0.00%)

Copy link
Member

@NidhiKJha NidhiKJha left a comment

Choose a reason for hiding this comment

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

All the events seem to be working except BannerCloseAll. It's not being dispatched
https://github.com/user-attachments/assets/fbe65e96-75b6-4f4b-815e-ffd250934146

@jonybur jonybur requested a review from NidhiKJha December 18, 2024 15:31
@metamaskbot
Copy link
Collaborator

Builds ready [8f5a4ab]
Page Load Metrics (1543 ± 75 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint13971987154815373
domContentLoaded13641976152315775
load13781988154315575
domInteractive22125352412
backgroundConnect86924188
firstReactRender1699423115
getState44910115
initialActions01000
loadScripts9771545113115072
setupStore67214199
uiStartup159922831829208100
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 856 Bytes (0.01%)
  • common: 118 Bytes (0.00%)

Copy link
Member

@NidhiKJha NidhiKJha left a comment

Choose a reason for hiding this comment

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

LGTM

@jonybur jonybur added this pull request to the merge queue Dec 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 19, 2024
@jonybur jonybur added this pull request to the merge queue Dec 19, 2024
Merged via the queue into main with commit d06dad7 Dec 19, 2024
77 checks passed
@jonybur jonybur deleted the jb-carousel-metrics branch December 19, 2024 12:53
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2024
@metamaskbot metamaskbot added the release-12.11.0 Issue or pull request that will be included in release 12.11.0 label Dec 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.11.0 Issue or pull request that will be included in release 12.11.0 team-wallet-ux
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants