11import type { ABTest , ABTestAPI } from '@guardian/ab-core' ;
2+ import { ABTests } from '@guardian/ab-testing' ;
23import {
34 bypassCommercialMetricsSampling ,
45 EventTimer ,
@@ -9,7 +10,6 @@ import {
910 initCoreWebVitals ,
1011} from '@guardian/core-web-vitals' ;
1112import { getCookie , isString , isUndefined } from '@guardian/libs' ;
12- import { ABTests } from 'ab-testing' ;
1313import { useCallback , useEffect , useState } from 'react' ;
1414import { useAB , useBetaAB } from '../lib/useAB' ;
1515import { useAdBlockInUse } from '../lib/useAdBlockInUse' ;
@@ -32,11 +32,11 @@ const clientSideTestsToForceMetrics: ABTest[] = [
3232 /* keep array multi-line */
3333] ;
3434
35- const shouldCollectMetricsForBetaTests = ( testParticipations : string [ ] ) => {
36- const participationConfigs = ABTests . filter ( ( test ) =>
37- testParticipations . includes ( test . name ) ,
35+ const shouldCollectMetricsForBetaTests = ( userTestParticipations : string [ ] ) => {
36+ const userParticipationConfigs = ABTests . filter ( ( test ) =>
37+ userTestParticipations . includes ( test . name ) ,
3838 ) ;
39- return participationConfigs . some (
39+ return userParticipationConfigs . some (
4040 ( test ) => test . shouldForceMetricsCollection ,
4141 ) ;
4242} ;
@@ -99,10 +99,10 @@ export const Metrics = ({ commercialMetricsEnabled, tests }: Props) => {
9999
100100 const userInServerSideTest = Object . keys ( tests ) . length > 0 ;
101101
102- const betaParticipations = betaABTest ?. getParticipations ( ) ?? { } ;
102+ const userBetaParticipations = betaABTest ?. getParticipations ( ) ?? { } ;
103103
104104 const collectBetaTestMetrics = shouldCollectMetricsForBetaTests (
105- Object . keys ( betaParticipations ) ,
105+ Object . keys ( userBetaParticipations ) ,
106106 ) ;
107107
108108 const shouldBypassSampling = useCallback (
0 commit comments