Skip to content

Commit fed6381

Browse files
Merge pull request #13740 from guardian/tf-choice-cards-benefits
Shorter benefits copy on banner choice cards
2 parents 1ede35e + a4fc07d commit fed6381

File tree

8 files changed

+54
-162
lines changed

8 files changed

+54
-162
lines changed

dotcom-rendering/src/components/marketing/banners/designableBanner/DesignableBannerV2.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
import { ThreeTierChoiceCards } from '../../epics/ThreeTierChoiceCards';
4040
import type { SupportTier } from '../../epics/utils/threeTierChoiceCardAmounts';
4141
import { useReminder } from '../../hooks/useReminder';
42+
import { getChoiceCardData } from '../../lib/choiceCards';
4243
import type { ReactComponent } from '../../lib/ReactComponent';
4344
import {
4445
addChoiceCardsProductParams,
@@ -447,7 +448,10 @@ const DesignableBannerV2: ReactComponent<BannerRenderProps> = ({
447448
setSelectedProduct={
448449
setThreeTierChoiceCardSelectedProduct
449450
}
450-
variantOfChoiceCard={'THREE_TIER_CHOICE_CARDS'}
451+
choices={getChoiceCardData(
452+
isTabletOrAbove,
453+
countryCode,
454+
)}
451455
/>
452456

453457
<div css={styles.ctaContainer}>

dotcom-rendering/src/components/marketing/epics/ContributionsEpic.stories.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -330,20 +330,6 @@ export const WithThreeTierChoiceCardsForUS: Story = {
330330
},
331331
};
332332

333-
export const WithThreeTierChoiceCardsSimplifiedForUS: Story = {
334-
name: 'ContributionsEpic with three tier choice cards for US (Simplified third choice)',
335-
args: {
336-
...meta.args,
337-
countryCode: 'US',
338-
variant: {
339-
...props.variant,
340-
name: 'TEST_EPIC_SIMPLIFIED_THIRD_CHOICE_CARD',
341-
secondaryCta: undefined,
342-
showChoiceCards: true,
343-
},
344-
},
345-
};
346-
347333
export const WithThreeTierDiscountChoiceCards: Story = {
348334
name: 'ContributionsEpic with discounted three tier choice cards',
349335
args: {

dotcom-rendering/src/components/marketing/epics/ContributionsEpic.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -269,18 +269,8 @@ const ContributionsEpic: ReactComponent<EpicProps> = ({
269269
openCmp,
270270
hasConsentForArticleCount,
271271
}: EpicProps) => {
272-
const {
273-
image,
274-
showChoiceCards,
275-
tickerSettings,
276-
choiceCardAmounts,
277-
newsletterSignup,
278-
} = variant;
279-
280-
const isSimpleThirdChoiceCardInTestVariant: boolean =
281-
(showChoiceCards &&
282-
variant.name.includes('EPIC_SIMPLIFIED_THIRD_CHOICE_CARD')) ??
283-
false;
272+
const { image, tickerSettings, choiceCardAmounts, newsletterSignup } =
273+
variant;
284274

285275
const { hasOptedOut, onArticleCountOptIn, onArticleCountOptOut } =
286276
useArticleCountOptOut();
@@ -434,9 +424,6 @@ const ContributionsEpic: ReactComponent<EpicProps> = ({
434424
submitComponentEvent={submitComponentEvent}
435425
amountsTestName={choiceCardAmounts?.testName}
436426
amountsVariantName={choiceCardAmounts?.variantName}
437-
isSimpleThirdChoiceCardInTestVariant={
438-
isSimpleThirdChoiceCardInTestVariant
439-
}
440427
/>
441428
)}
442429

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { isUndefined } from '@guardian/libs';
22
import type { ChoiceInfo } from './ThreeTierChoiceCards';
33

4-
export const ChoiceCardTestData_REGULAR: ChoiceInfo[] = [
4+
export const ChoiceCardTestData_REGULAR = (
5+
longerBenefits: boolean,
6+
): ChoiceInfo[] => [
57
{
68
supportTier: 'Contribution',
79
label: (amount: number, currencySymbol: string): string =>
@@ -36,13 +38,10 @@ export const ChoiceCardTestData_REGULAR: ChoiceInfo[] = [
3638
}
3739
},
3840
benefitsLabel: 'All-access digital',
39-
benefits: () => [
40-
'Unlimited access to the Guardian app',
41-
'Unlimited access to our new Feast App',
42-
'Ad-free reading on all your devices',
43-
'Exclusive newsletter for supporters, sent every week from the Guardian newsroom',
44-
'Far fewer asks for support',
45-
],
41+
benefits: () =>
42+
longerBenefits
43+
? fullSupporterPlusBenefits
44+
: shorterSupporterPlusBenefits,
4645
recommended: true,
4746
},
4847
{
@@ -54,7 +53,9 @@ export const ChoiceCardTestData_REGULAR: ChoiceInfo[] = [
5453
},
5554
];
5655

57-
export const ChoiceCardTestData_US: ChoiceInfo[] = [
56+
export const ChoiceCardTestData_US = (
57+
longerBenefits: boolean,
58+
): ChoiceInfo[] => [
5859
{
5960
supportTier: 'Contribution',
6061
label: (amount: number, currencySymbol: string): string =>
@@ -70,13 +71,10 @@ export const ChoiceCardTestData_US: ChoiceInfo[] = [
7071
label: (amount: number, currencySymbol: string): string =>
7172
`Support ${currencySymbol}${amount}/month`,
7273
benefitsLabel: 'All-access digital',
73-
benefits: () => [
74-
'Unlimited access to the Guardian app',
75-
'Unlimited access to our new Feast App',
76-
'Ad-free reading on all your devices',
77-
'Exclusive newsletter for supporters, sent every week from the Guardian newsroom',
78-
'Far fewer asks for support',
79-
],
74+
benefits: () =>
75+
longerBenefits
76+
? fullSupporterPlusBenefits
77+
: shorterSupporterPlusBenefits,
8078
recommended: true,
8179
},
8280
{
@@ -91,38 +89,16 @@ export const ChoiceCardTestData_US: ChoiceInfo[] = [
9189
},
9290
];
9391

94-
export const ChoiceCardTestData_US_SIMPLIFIED: ChoiceInfo[] = [
95-
{
96-
supportTier: 'Contribution',
97-
label: (amount: number, currencySymbol: string): string =>
98-
`Support ${currencySymbol}${amount}/month`,
99-
benefitsLabel: 'Support',
100-
benefits: () => [
101-
'Exclusive newsletter for supporters, sent every week from the Guardian newsroom',
102-
],
103-
recommended: false,
104-
},
105-
{
106-
supportTier: 'SupporterPlus',
107-
label: (amount: number, currencySymbol: string): string =>
108-
`Support ${currencySymbol}${amount}/month`,
109-
benefitsLabel: 'All-access digital',
110-
benefits: () => [
111-
'Unlimited access to the Guardian app',
112-
'Unlimited access to our new Feast App',
113-
'Ad-free reading on all your devices',
114-
'Exclusive newsletter for supporters, sent every week from the Guardian newsroom',
115-
'Far fewer asks for support',
116-
],
117-
recommended: true,
118-
},
119-
{
120-
supportTier: 'OneOff',
121-
label: (): string => `Support with another amount`,
122-
benefitsLabel: undefined,
123-
benefits: () => [
124-
`We welcome all support, whether big or small, one-time or recurring`,
125-
],
126-
recommended: false,
127-
},
92+
const fullSupporterPlusBenefits = [
93+
'Unlimited access to the Guardian app',
94+
'Unlimited access to our new Feast App',
95+
'Ad-free reading on all your devices',
96+
'Exclusive newsletter for supporters, sent every week from the Guardian newsroom',
97+
'Far fewer asks for support',
98+
];
99+
100+
const shorterSupporterPlusBenefits = [
101+
'Unlimited access to the Guardian app and Feast app',
102+
'Ad-free reading on all your devices',
103+
'Exclusive supporter newsletter',
128104
];

dotcom-rendering/src/components/marketing/epics/ThreeTierChoiceCards.tsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ import {
2222
getLocalCurrencySymbol,
2323
} from '@guardian/support-dotcom-components';
2424
import type { Dispatch, SetStateAction } from 'react';
25-
import {
26-
ChoiceCardTestData_REGULAR,
27-
ChoiceCardTestData_US,
28-
ChoiceCardTestData_US_SIMPLIFIED,
29-
} from './ThreeTierChoiceCardData';
3025
import type {
3126
SupportRatePlan,
3227
SupportTier,
@@ -186,41 +181,28 @@ type ThreeTierChoiceCardsProps = {
186181
selectedProduct: SupportTier;
187182
setSelectedProduct: Dispatch<SetStateAction<SupportTier>>;
188183
countryCode?: string;
189-
variantOfChoiceCard: string;
184+
choices: ChoiceInfo[];
190185
supporterPlusDiscount?: number;
191186
};
192187

193-
const getChoiceCardData = (choiceCardVariant: string): ChoiceInfo[] => {
194-
switch (choiceCardVariant) {
195-
case 'US_THREE_TIER_CHOICE_CARDS':
196-
return ChoiceCardTestData_US;
197-
case 'US_SIMPLIFY_THIRD_CHOICE_CARD':
198-
return ChoiceCardTestData_US_SIMPLIFIED;
199-
default:
200-
return ChoiceCardTestData_REGULAR;
201-
}
202-
};
203-
204188
export const ThreeTierChoiceCards = ({
205189
countryCode,
206190
selectedProduct,
207191
setSelectedProduct,
208-
variantOfChoiceCard,
192+
choices,
209193
supporterPlusDiscount,
210194
}: ThreeTierChoiceCardsProps) => {
211195
const currencySymbol = getLocalCurrencySymbol(countryCode);
212196
const countryGroupId = countryCodeToCountryGroupId(countryCode);
213197

214-
const Choices = getChoiceCardData(variantOfChoiceCard);
215-
216198
return (
217199
<RadioGroup
218200
cssOverrides={css`
219201
margin-top: ${space[6]}px;
220202
`}
221203
>
222204
<Stack space={3}>
223-
{Choices.map(
205+
{choices.map(
224206
({
225207
supportTier,
226208
label,

dotcom-rendering/src/components/marketing/epics/ctas/ContributionsEpicButtons.tsx

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { useIsInView } from '../../../../lib/useIsInView';
2121
import { hasSetReminder } from '../../lib/reminders';
2222
import {
2323
addChoiceCardsOneTimeParams,
24-
addChoiceCardsParams,
2524
addChoiceCardsProductParams,
2625
addRegionIdAndTrackingParamsToSupportUrl,
2726
isSupportUrl,
@@ -151,7 +150,6 @@ interface ContributionsEpicButtonsProps {
151150
amountsTestName?: string;
152151
amountsVariantName?: string;
153152
numArticles: number;
154-
variantOfChoiceCard?: string;
155153
}
156154

157155
export const ContributionsEpicButtons = ({
@@ -167,7 +165,6 @@ export const ContributionsEpicButtons = ({
167165
amountsTestName,
168166
amountsVariantName,
169167
numArticles,
170-
variantOfChoiceCard,
171168
}: ContributionsEpicButtonsProps): JSX.Element | null => {
172169
const [hasBeenSeen, setNode] = useIsInView({
173170
debounce: true,
@@ -190,22 +187,8 @@ export const ContributionsEpicButtons = ({
190187
}
191188

192189
const getChoiceCardCta = (cta: Cta): Cta => {
193-
/** In the US - direct 50 % traffic to the checkout page and 50 % traffic to the landing page for the AB test */
194-
195-
if (showChoiceCards && countryCode === 'US') {
190+
if (showChoiceCards) {
196191
if (threeTierChoiceCardSelectedProduct === 'OneOff') {
197-
if (
198-
variantOfChoiceCard ===
199-
'US_CHECKOUT_THREE_TIER_CHOICE_CARDS'
200-
) {
201-
return {
202-
text: cta.text,
203-
baseUrl: addChoiceCardsParams(
204-
'https://support.theguardian.com/contribute/checkout',
205-
'ONE_OFF',
206-
),
207-
};
208-
}
209192
return {
210193
text: cta.text,
211194
baseUrl: addChoiceCardsOneTimeParams(cta.baseUrl),
@@ -219,45 +202,14 @@ export const ContributionsEpicButtons = ({
219202
? threeTierChoiceCardAmounts['Monthly'][countryGroupId]
220203
.Contribution
221204
: undefined;
222-
const url =
223-
variantOfChoiceCard === 'US_CHECKOUT_THREE_TIER_CHOICE_CARDS'
224-
? 'https://support.theguardian.com/checkout'
225-
: cta.baseUrl;
226-
227-
return {
228-
text: cta.text,
229-
baseUrl: addChoiceCardsProductParams(
230-
url,
231-
threeTierChoiceCardSelectedProduct,
232-
'Monthly',
233-
contributionAmount,
234-
),
235-
};
236-
}
237-
238-
/** Not in the US - direct taffic to the landing page */
239-
if (
240-
showChoiceCards &&
241-
variantOfChoiceCard === 'THREE_TIER_CHOICE_CARDS'
242-
) {
243-
if (threeTierChoiceCardSelectedProduct === 'OneOff') {
244-
/**
245-
* OneOff payments are not supported by the generic checkout yet.
246-
* We also have no way of highlighting to a contributor that "OneOff"
247-
* was selected, so we just send them to the homepage.
248-
*/
249-
return {
250-
text: cta.text,
251-
baseUrl: 'https://support.theguardian.com/contribute',
252-
};
253-
}
254205

255206
return {
256207
text: cta.text,
257208
baseUrl: addChoiceCardsProductParams(
258209
cta.baseUrl,
259210
threeTierChoiceCardSelectedProduct,
260211
'Monthly',
212+
contributionAmount,
261213
),
262214
};
263215
}

dotcom-rendering/src/components/marketing/epics/ctas/ContributionsEpicCtasContainer.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { EpicProps } from '@guardian/support-dotcom-components/dist/shared/types/props/epic';
22
import { useState } from 'react';
3+
import { getChoiceCardData } from '../../lib/choiceCards';
34
import type { ReactComponent } from '../../lib/ReactComponent';
45
import { ThreeTierChoiceCards } from '../ThreeTierChoiceCards';
56
import type { SupportTier } from '../utils/threeTierChoiceCardAmounts';
@@ -13,7 +14,6 @@ interface OnReminderOpen {
1314
type Props = EpicProps & {
1415
amountsTestName?: string;
1516
amountsVariantName?: string;
16-
isSimpleThirdChoiceCardInTestVariant?: boolean;
1717
};
1818

1919
export const ContributionsEpicCtasContainer: ReactComponent<Props> = ({
@@ -26,7 +26,6 @@ export const ContributionsEpicCtasContainer: ReactComponent<Props> = ({
2626
fetchEmail,
2727
amountsTestName,
2828
amountsVariantName,
29-
isSimpleThirdChoiceCardInTestVariant,
3029
}: Props): JSX.Element => {
3130
// reminders
3231
const [fetchedEmail, setFetchedEmail] = useState<string | undefined>(
@@ -57,21 +56,14 @@ export const ContributionsEpicCtasContainer: ReactComponent<Props> = ({
5756
const hasSupporterPlusPromoCode =
5857
variant.cta?.baseUrl.includes('BLACK_FRIDAY_DISCOUNT_2024') ?? false;
5958

60-
const variantOfChoiceCard =
61-
countryCode === 'US' && isSimpleThirdChoiceCardInTestVariant
62-
? 'US_SIMPLIFY_THIRD_CHOICE_CARD'
63-
: countryCode === 'US'
64-
? 'US_THREE_TIER_CHOICE_CARDS'
65-
: 'THREE_TIER_CHOICE_CARDS';
66-
6759
return (
6860
<>
6961
{showChoiceCards && (
7062
<ThreeTierChoiceCards
7163
countryCode={countryCode}
7264
selectedProduct={threeTierChoiceCardSelectedProduct}
7365
setSelectedProduct={setThreeTierChoiceCardSelectedProduct}
74-
variantOfChoiceCard={variantOfChoiceCard}
66+
choices={getChoiceCardData(true, countryCode)}
7567
supporterPlusDiscount={
7668
hasSupporterPlusPromoCode ? 0.5 : undefined
7769
}
@@ -115,7 +107,6 @@ export const ContributionsEpicCtasContainer: ReactComponent<Props> = ({
115107
amountsTestName={amountsTestName}
116108
amountsVariantName={amountsVariantName}
117109
numArticles={articleCounts.for52Weeks}
118-
variantOfChoiceCard={variantOfChoiceCard}
119110
/>
120111
{isReminderActive && showReminderFields && (
121112
<ContributionsEpicReminder

0 commit comments

Comments
 (0)