Skip to content

Commit 05aaa60

Browse files
committed
add client side test for comparison
1 parent dca15dc commit 05aaa60

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

dotcom-rendering/src/components/Metrics.importable.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { useDetectAdBlock } from '../lib/useDetectAdBlock';
1717
import { usePageViewId } from '../lib/usePageViewId';
1818
import type { ServerSideTests } from '../types/config';
1919
import { useConfig } from './ConfigContext';
20+
import { compareClientTestWithNewFramework } from 'src/experiments/tests/compare-client-test-with-new-framework';
2021

2122
type Props = {
2223
commercialMetricsEnabled: boolean;
@@ -30,6 +31,7 @@ const willRecordCoreWebVitals = Math.random() < sampling;
3031
// For these tests switch off sampling and collect metrics for 100% of views
3132
const clientSideTestsToForceMetrics: ABTest[] = [
3233
/* keep array multi-line */
34+
compareClientTestWithNewFramework,
3335
];
3436

3537
const shouldCollectMetricsForBetaTests = (userTestParticipations: string[]) => {

dotcom-rendering/src/experiments/ab-tests.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { auxiaSignInGate } from './tests/auxia-sign-in-gate';
44
import { signInGateMainControl } from './tests/sign-in-gate-main-control';
55
import { signInGateMainVariant } from './tests/sign-in-gate-main-variant';
66
import { userBenefitsApi } from './tests/user-benefits-api';
7+
import { compareClientTestWithNewFramework } from './tests/compare-client-test-with-new-framework';
78

89
// keep in sync with ab-tests in frontend
910
// https://github.com/guardian/frontend/tree/main/static/src/javascripts/projects/common/modules/experiments/ab-tests.ts
@@ -13,4 +14,5 @@ export const tests: ABTest[] = [
1314
signInGateMainControl,
1415
userBenefitsApi,
1516
auxiaSignInGate,
17+
compareClientTestWithNewFramework,
1618
];
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import type { ABTest } from '@guardian/ab-core';
2+
3+
export const compareClientTestWithNewFramework: ABTest = {
4+
id: 'CompareClientTestWithNewFramework',
5+
start: '2025-10-08',
6+
expiry: '2025-11-01',
7+
author: 'Commercial Dev',
8+
description:
9+
'A test to compare the old and new AB testing frameworks in DCR',
10+
audience: 10 / 100,
11+
audienceOffset: 0,
12+
successMeasure:
13+
'No success measure, this is just to compare the two frameworks',
14+
audienceCriteria: 'Everyone',
15+
showForSensitive: true,
16+
canRun: () => true,
17+
variants: [
18+
{
19+
id: 'control',
20+
test: (): void => {
21+
/* no-op */
22+
},
23+
},
24+
{
25+
id: 'variant',
26+
test: (): void => {
27+
/* no-op */
28+
},
29+
},
30+
],
31+
};

0 commit comments

Comments
 (0)