Skip to content

Commit a1ec92d

Browse files
adding new variant variant2 which does not show the RR banner
1 parent afa7a9f commit a1ec92d

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

ab-testing/config/abTests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ const ABTests: ABTest[] = [
215215
status: "ON",
216216
audienceSize: 0 / 100,
217217
audienceSpace: "B",
218-
groups: ["control", "variant"],
218+
groups: ["control", "variant", "variant2"],
219219
shouldForceMetricsCollection: true,
220220
},
221221
{

dotcom-rendering/src/components/StickyBottomBanner.island.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ const buildRRBannerConfigWith = ({
125125
pageId,
126126
inHoldbackGroup,
127127
inAuxiaVariant,
128+
inNoShowMobileAboveNavVariant,
128129
}: {
129130
isSignedIn: boolean;
130131
countryCode: CountryCode;
@@ -144,6 +145,7 @@ const buildRRBannerConfigWith = ({
144145
pageId?: string;
145146
inHoldbackGroup?: boolean;
146147
inAuxiaVariant?: boolean;
148+
inNoShowMobileAboveNavVariant?: boolean;
147149
}): CandidateConfig<ModuleData<BannerProps>> => {
148150
return {
149151
candidate: {
@@ -182,6 +184,7 @@ const buildRRBannerConfigWith = ({
182184
pageId,
183185
inHoldbackGroup,
184186
inAuxiaVariant,
187+
inNoShowMobileAboveNavVariant,
185188
}),
186189
show: ({ name, props }: ModuleData<BannerProps>) => (
187190
<BannerComponent name={name} props={props} />
@@ -339,6 +342,11 @@ export const StickyBottomBanner = ({
339342
'control',
340343
) ?? false,
341344
inAuxiaVariant,
345+
inNoShowMobileAboveNavVariant:
346+
abTests?.isUserInTestGroup(
347+
'commercial-mobile-above-nav-test',
348+
'variant2',
349+
) ?? false,
342350
});
343351
const brazeArticleContext: BrazeArticleContext = {
344352
section: sectionId,

dotcom-rendering/src/components/StickyBottomBanner/ReaderRevenueBanner.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type BaseProps = {
5252
pageId?: string;
5353
inHoldbackGroup?: boolean;
5454
inAuxiaVariant?: boolean;
55+
inNoShowMobileAboveNavVariant?: boolean;
5556
};
5657

5758
type BuildPayloadProps = BaseProps & {
@@ -76,6 +77,19 @@ export type CanShowFunctionType<T> = (
7677
props: CanShowProps,
7778
) => Promise<CanShowResult<T>>;
7879

80+
// the test includes the crossword pages (tag type/crossword) and the crosswords front (pageId === 'crosswords')
81+
const isInMobileAboveNavTest = (
82+
tags: TagType[],
83+
renderingTarget: RenderingTarget,
84+
pageId?: string,
85+
): boolean => {
86+
return (
87+
(tags.some((tag) => tag.id === 'type/crossword') ||
88+
pageId === 'crosswords') &&
89+
renderingTarget === 'Web'
90+
);
91+
};
92+
7993
const getArticleCountToday = (
8094
articleCounts: ArticleCounts | undefined,
8195
): number | undefined => {
@@ -209,7 +223,15 @@ export const canShowRRBanner: CanShowFunctionType<
209223
pageId,
210224
inHoldbackGroup,
211225
inAuxiaVariant,
226+
inNoShowMobileAboveNavVariant,
212227
}) => {
228+
if (
229+
inNoShowMobileAboveNavVariant === true &&
230+
isInMobileAboveNavTest(tags, renderingTarget, pageId)
231+
) {
232+
return { show: false };
233+
}
234+
213235
if (!remoteBannerConfig) {
214236
return { show: false };
215237
}

0 commit comments

Comments
 (0)