Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3feccf9
added pna-25 banner
NidhiKJha Nov 21, 2025
85cc83d
added pna25 banner to use boolean logic
NidhiKJha Nov 24, 2025
26e9ed2
updated selector
NidhiKJha Nov 24, 2025
1bfb72b
show banner
NidhiKJha Nov 24, 2025
82adc6d
nit fix
NidhiKJha Nov 24, 2025
330dfdb
locale update
NidhiKJha Nov 24, 2025
d270e72
updated metametrics link
NidhiKJha Nov 24, 2025
3ff5436
nit fix
NidhiKJha Nov 25, 2025
8e6603e
jest update
NidhiKJha Nov 25, 2025
82a81c8
added sentry state
NidhiKJha Nov 25, 2025
26821c2
sentry update
NidhiKJha Nov 25, 2025
c787954
sentry update
NidhiKJha Nov 25, 2025
ba6bbab
lint fix
NidhiKJha Nov 25, 2025
79d3892
nit fix
NidhiKJha Nov 25, 2025
cf8d1dd
Merge branch 'main' into CEUX-713-pna-25
NidhiKJha Nov 25, 2025
9aa85c1
metrics update
NidhiKJha Nov 25, 2025
eed9b2a
lint fix
NidhiKJha Nov 25, 2025
cc388b3
lint fix
NidhiKJha Nov 25, 2025
f3a4bda
Merge branch 'main' into CEUX-713-pna-25
NidhiKJha Nov 26, 2025
8450372
lint fix
NidhiKJha Nov 26, 2025
2386bc4
Merge branch 'main' into CEUX-713-pna-25
NidhiKJha Nov 26, 2025
58a3457
updated state to be boolea
NidhiKJha Nov 26, 2025
4bfd97d
lint fix
NidhiKJha Nov 26, 2025
e6758fc
lint fix
NidhiKJha Nov 26, 2025
971c1d0
added onboarding
NidhiKJha Nov 26, 2025
7b4cf07
added build flag
NidhiKJha Nov 26, 2025
a23ac5d
added pna banner
NidhiKJha Nov 26, 2025
af8f50e
removed unused code
NidhiKJha Nov 27, 2025
395951e
Merge branch 'main' into CEUX-713-pna-25
NidhiKJha Nov 27, 2025
1252cb7
nit fix
NidhiKJha Nov 27, 2025
b70dd38
updated welcome logic
NidhiKJha Nov 27, 2025
7af809a
lint fix
NidhiKJha Nov 27, 2025
5236ca2
added metrics logic to settings
NidhiKJha Nov 27, 2025
ca876f7
Merge branch 'main' into CEUX-713-pna-25
NidhiKJha Nov 27, 2025
7a157ea
updated sentry state
NidhiKJha Nov 27, 2025
bf7d334
Merge branch 'main' into CEUX-713-pna-25
NidhiKJha Nov 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added metrics logic to settings
  • Loading branch information
NidhiKJha committed Nov 27, 2025
commit 5236ca25936de0002d8afaf33c4f887660479717
13 changes: 11 additions & 2 deletions ui/hooks/useMetametrics.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { useState, useCallback } from 'react';
import { useDispatch } from 'react-redux';
import { useDispatch, useSelector } from 'react-redux';
import log from 'loglevel';
import {
setParticipateInMetaMetrics,
setPna25Acknowledged,
showLoadingIndication,
hideLoadingIndication,
} from '../store/actions';
import { getPna25Acknowledged } from '../selectors/metametrics';
import { getRemoteFeatureFlags } from '../selectors/remote-feature-flags';

/**
* Provides a hook to enable MetaMetrics tracking.
Expand All @@ -22,6 +25,8 @@ export function useEnableMetametrics(): {

const [loading, setLoading] = useState<boolean>(false);
const [error, setError] = useState<string | null>(null);
const pna25Acknowledged = useSelector(getPna25Acknowledged);
const remoteFeatureFlags = useSelector(getRemoteFeatureFlags);

const enableMetametrics = useCallback(async () => {
setLoading(true);
Expand All @@ -30,6 +35,10 @@ export function useEnableMetametrics(): {

try {
await dispatch(setParticipateInMetaMetrics(true));
const isPna25Enabled = remoteFeatureFlags?.extensionUxPna25;
if (isPna25Enabled && pna25Acknowledged === false) {
await dispatch(setPna25Acknowledged(true));
}
} catch (e) {
setError(e instanceof Error ? e.message : 'An unexpected error occurred');
log.error(e);
Expand All @@ -40,7 +49,7 @@ export function useEnableMetametrics(): {
}

dispatch(hideLoadingIndication());
}, [dispatch]);
}, [dispatch, pna25Acknowledged, remoteFeatureFlags]);

return {
enableMetametrics,
Expand Down
5 changes: 5 additions & 0 deletions ui/pages/onboarding-flow/welcome/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
setFirstTimeFlowType,
startOAuthLogin,
setParticipateInMetaMetrics,
setPna25Acknowledged,
getIsSeedlessOnboardingUserAuthenticated,
} from '../../../store/actions';
import {
Expand Down Expand Up @@ -420,6 +421,10 @@ export default function OnboardingWelcome() {
if (!isFireFox) {
// automatically set participate in meta metrics to true for social login users in chrome
dispatch(setParticipateInMetaMetrics(true));
// Set pna25Acknowledged to true for social login users if feature flag is enabled
if (process.env.EXTENSION_UX_PNA25) {
dispatch(setPna25Acknowledged(true));
}
}
} catch (error) {
handleLoginError(error);
Expand Down
2 changes: 2 additions & 0 deletions ui/selectors/metametrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export const getParticipateInMetaMetrics = (state) =>
export const getIsParticipateInMetaMetricsSet = (state) =>
state.metamask.participateInMetaMetrics !== null;

export const getPna25Acknowledged = (state) => state.metamask.pna25Acknowledged;

export const getLatestMetricsEventTimestamp = (state) =>
state.metamask.latestNonAnonymousEventTimestamp;

Expand Down
Loading