Skip to content

Commit d65fa2b

Browse files
authored
Merge pull request #14789 from guardian/jm/feat-improve-sign-in-gate-click-tracking
send treatment id and labels to click tracking
2 parents 09e3da2 + 979e15b commit d65fa2b

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

dotcom-rendering/src/components/SignInGate/componentEventTracking.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ export const trackLink = (
5858
value: string,
5959
renderingTarget: RenderingTarget,
6060
abTest?: CurrentSignInGateABTest,
61+
labels?: string[],
6162
): void => {
62-
const component = withComponentId(componentId);
63+
const component = { ...withComponentId(componentId), labels };
6364

6465
submitClickEventTracking(
6566
{

dotcom-rendering/src/components/SignInGate/gateDesigns/SignInGateAuxiaV1.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export const SignInGateAuxiaV1 = ({
9898
`sign-in-${provider}-${dismissStatusLabel}`,
9999
renderingTarget,
100100
abTest,
101+
[userTreatment.treatmentType],
101102
);
102103
void logTreatmentInteractionCall(
103104
'CLICKED',
@@ -119,6 +120,7 @@ export const SignInGateAuxiaV1 = ({
119120
`sign-in-${provider}-${dismissStatusLabel}`,
120121
renderingTarget,
121122
abTest,
123+
[userTreatment.treatmentType],
122124
);
123125
void logTreatmentInteractionCall(
124126
'CLICKED',

dotcom-rendering/src/components/SignInGate/gateDesigns/SignInGateAuxiaV2.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export const SignInGateAuxiaV2 = ({
216216
`sign-in-${provider}-${dismissStatusLabel}`,
217217
renderingTarget,
218218
abTest,
219+
[userTreatment.treatmentType],
219220
);
220221
void logTreatmentInteractionCall(
221222
'CLICKED',
@@ -238,6 +239,7 @@ export const SignInGateAuxiaV2 = ({
238239
`sign-in-${provider}-${dismissStatusLabel}`,
239240
renderingTarget,
240241
abTest,
242+
[userTreatment.treatmentType],
241243
);
242244
void logTreatmentInteractionCall(
243245
'CLICKED',

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ const ShowSignInGateAuxia = ({
396396
logTreatmentInteractionCall,
397397
signInGateVersion,
398398
}: ShowSignInGateAuxiaProps) => {
399-
const componentId = 'main_variant_5';
400399
const checkoutCompleteCookieData = undefined;
401400
const personaliseSignInGateAfterCheckoutSwitch = undefined;
402401

@@ -468,7 +467,6 @@ const ShowSignInGateAuxia = ({
468467
}
469468
}
470469
}, [
471-
componentId,
472470
hasBeenSeen,
473471
browserId,
474472
contributionsServiceUrl,
@@ -486,7 +484,7 @@ const ShowSignInGateAuxia = ({
486484
setShowGate(false);
487485
},
488486
abTest,
489-
ophanComponentId: componentId,
487+
ophanComponentId: treatmentId,
490488
checkoutCompleteCookieData,
491489
personaliseSignInGateAfterCheckoutSwitch,
492490
userTreatment,

0 commit comments

Comments
 (0)