Skip to content

Commit 17508a1

Browse files
authored
Merge pull request #13388 from guardian/ph-20250214-1417-betterOphanNotifications
auxia experiment: Enrich abTest value for better tracking of the Auxia variant
2 parents e22ca18 + 69f5f69 commit 17508a1

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,20 @@ const SignInGateSelectorAuxia = ({
587587
This function if the Auxia prototype for the SignInGateSelector component.
588588
*/
589589

590+
const buildAbTestTrackingAuxiaVariant = (
591+
treatmentId: string,
592+
): {
593+
name: string;
594+
variant: string;
595+
id: string;
596+
} => {
597+
return {
598+
name: 'AuxiaSignInGate',
599+
variant: treatmentId,
600+
id: treatmentId,
601+
};
602+
};
603+
590604
const authStatus = useAuthStatus();
591605

592606
const isSignedIn =
@@ -640,7 +654,9 @@ const SignInGateSelectorAuxia = ({
640654
id: data.auxiaData.userTreatment.treatmentId,
641655
},
642656
action: 'VIEW',
643-
abTest,
657+
abTest: buildAbTestTrackingAuxiaVariant(
658+
data.auxiaData.userTreatment.treatmentId,
659+
),
644660
},
645661
renderingTarget,
646662
);
@@ -675,7 +691,10 @@ const SignInGateSelectorAuxia = ({
675691
signInUrl={signInUrl}
676692
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions -- Odd react types, should review
677693
setShowGate={(show) => setIsGateDismissed(!show)}
678-
abTest={abTest}
694+
abTest={buildAbTestTrackingAuxiaVariant(
695+
auxiaGateDisplayData.auxiaData.userTreatment
696+
.treatmentId,
697+
)}
679698
userTreatment={
680699
auxiaGateDisplayData.auxiaData.userTreatment
681700
}

0 commit comments

Comments
 (0)