Skip to content

Commit 59ea52c

Browse files
Add joinHref to Sourcepoint Config. (#1988)
* Add joinHref to Sourcepoint Config * Create funny-news-occur.md * Revert "Remove isCorpABTest Flag (#1982)" This reverts commit df58c5f.
1 parent e5ffb81 commit 59ea52c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.changeset/funny-news-occur.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@guardian/libs': minor
3+
---
4+
5+
Add joinHref property to Sourcepoint Config

libs/@guardian/libs/src/consent-management-platform/sourcepoint.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,14 @@ export const init = (
114114

115115
setCurrentFramework(framework);
116116

117+
const isCorpABTest: boolean = window.location.search.includes('CORP_FLAG');
117118
// To ensure users who are not part of Consent or Pay country or AB Test
118-
if (!isConsentOrPayCountry(countryCode)) {
119+
if (!isCorpABTest || !isConsentOrPayCountry(countryCode)) {
119120
useNonAdvertisedList = false;
120121
}
121122

122123
setIsConsentOrPay(
123-
isConsentOrPayCountry(countryCode) && !useNonAdvertisedList,
124+
isConsentOrPayCountry(countryCode) && !useNonAdvertisedList && isCorpABTest,
124125
);
125126

126127
// invoke callbacks before we receive Sourcepoint
@@ -159,6 +160,7 @@ export const init = (
159160
accountId: ACCOUNT_ID,
160161
propertyId: getPropertyId(framework, useNonAdvertisedList),
161162
propertyHref: getPropertyHref(framework, useNonAdvertisedList),
163+
joinHref: true,
162164
isSPA: true,
163165
targetingParams: {
164166
framework,
@@ -240,7 +242,8 @@ export const init = (
240242
choiceTypeID === SourcePointChoiceTypes.RejectAll &&
241243
message_type === 'gdpr' &&
242244
isConsentOrPayCountry(countryCode) &&
243-
!useNonAdvertisedList
245+
!useNonAdvertisedList &&
246+
isCorpABTest
244247
) {
245248
window.location.href = getSupportSignUpPage();
246249
}
@@ -306,6 +309,7 @@ export const init = (
306309
excludePage: isExcludedFromCMP(pageSection),
307310
isCorP: isConsentOrPayCountry(countryCode),
308311
isUserSignedIn,
312+
isCorpABTest,
309313
},
310314
};
311315
break;

libs/@guardian/libs/src/consent-management-platform/types/window.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ declare global {
3232
config: {
3333
baseEndpoint: EndPoint;
3434
accountId: number;
35+
joinHref: boolean;
3536
propertyHref?: Property;
3637
propertyId?: number;
3738
campaignEnv?: 'prod' | 'stage';
@@ -51,6 +52,7 @@ declare global {
5152
excludePage: boolean;
5253
isCorP: boolean;
5354
isUserSignedIn: boolean;
55+
isCorpABTest: boolean;
5456
};
5557
};
5658
usnat?: {

0 commit comments

Comments
 (0)