Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WORLDSERVICE-418: Optimizely Experiment Lite Site CTA #12557

Merged
merged 27 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
05e0b65
WORLDSERVICE-418: Add experiment labels to config
shayneahchoon Mar 24, 2025
98e1ab5
WORLDSERVICE-418: Update healthcheck for WORLDSERVICE-444
shayneahchoon Mar 25, 2025
5958bc8
WORLDSERVICE-418: Add experimentation details.
shayneahchoon Mar 25, 2025
3138541
WORLDSERVICE-418: Update tests.
shayneahchoon Mar 26, 2025
5258126
WORLDSERVICE-418: Update tests.
shayneahchoon Mar 26, 2025
caa1af1
WORLDSERVICE-418: Add details.
shayneahchoon Mar 26, 2025
1373c1e
WORLDSERVICE-418: Update.
shayneahchoon Mar 27, 2025
9ef326a
WORLDSERVICE-418: Add ati tracking information.
shayneahchoon Mar 27, 2025
7b873cf
WORLDSERVICE-418: Remove console log.
shayneahchoon Mar 27, 2025
0cf0633
WORLDSERVICE-418: Update details.
shayneahchoon Mar 27, 2025
5733e88
WORLDSERVICE-418: Temporary.
Louis-Matsika Mar 27, 2025
609024b
WORLDSERVICE-418: Update details.
shayneahchoon Mar 31, 2025
38c3204
WORLDSERVICE-418: Update details.
shayneahchoon Mar 31, 2025
2b428eb
WORLDSERVICE-418: Update details.
shayneahchoon Mar 31, 2025
a61627d
WORLDSERVICE-418: Update details.
shayneahchoon Mar 31, 2025
f054507
WORLDSERVICE-418: Update test.
shayneahchoon Mar 31, 2025
81bf55e
WORLDSERVICE-418: Update test.
shayneahchoon Mar 31, 2025
15fb0fe
WORLDSERVICE-418: Update test.
shayneahchoon Mar 31, 2025
c80afc7
WORLDSERVICE-418: Update test.
shayneahchoon Mar 31, 2025
dcd695f
Merge branch 'latest' into WORLDSERVICE-418-lite-cta-optimizely
shayneahchoon Apr 1, 2025
1ab639c
Merge branch 'latest' into WORLDSERVICE-418-lite-cta-optimizely
HarveyPeachey Apr 1, 2025
3e41b62
WORLDSERVICE-418: Update test.
shayneahchoon Apr 1, 2025
4b156da
Merge branch 'WORLDSERVICE-418-lite-cta-optimizely' of github.com:bbc…
shayneahchoon Apr 1, 2025
9bd8c48
WORLDSERVICE-418: Update test.
shayneahchoon Apr 1, 2025
a15c937
WORLDSERVICE-418: Remove wsoj serverside bits.
shayneahchoon Apr 1, 2025
58563f4
Merge branch 'latest' into WORLDSERVICE-418-lite-cta-optimizely
shayneahchoon Apr 1, 2025
1825e35
WORLDSERVICE-418: Remove wsoj serverside bits.
shayneahchoon Apr 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/e2e/pages/articles/testsForCanonicalOnly.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default ({ service, pageType, variant = 'default' }) =>

if (liteEnabledServices.includes(service)) {
describe('Canonical Lite Site CTA', () => {
it('should have a lite site CTA', () => {
it.skip('should have a lite site CTA', () => {
cy.get('[data-e2e="to-lite-site"]').within(() => {
cy.get('a')
.should('have.attr', 'href')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const assertCanonicalToLiteSiteCTAComponentView = ({
useReverb,
path,
}) => {
it('should send a view event for the Canonical to Lite Site CTA component', () => {
it.skip('should send a view event for the Canonical to Lite Site CTA component', () => {
interceptATIAnalyticsBeacons();
cy.visit(path);

Expand All @@ -30,7 +30,7 @@ export const assertCanonicalToLiteSiteCTAComponentClick = ({
useReverb,
path,
}) => {
it('should send a click event for the Canonical to Lite Site CTA component', () => {
it.skip('should send a click event for the Canonical to Lite Site CTA component', () => {
interceptATIAnalyticsBeacons();
cy.visit(path);

Expand Down
6 changes: 3 additions & 3 deletions src/app/components/ATIAnalytics/atiUrl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ export const buildATIPageTrackPath = ({
? [
{
key: 'mv_test',
description: 'Top Bar OJs experiment',
value: 'Top Bar OJs experiment',
description: 'Lite Site Promotion experiment',
value: 'Lite_Site_Promotion_experiment',
wrap: false,
disableEncoding: true,
},
{
key: 'mv_creation',
description: 'Top Bar OJs variant',
description: 'Lite Site Promotion variant',
value: `${experimentVariant}`,
wrap: false,
disableEncoding: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { PropsWithChildren } from 'react';
import { SerializedStyles } from '@emotion/react';
import CallToActionLinkWithChevron from '.';
import { CallToActionLinkProps } from '../CallToActionLink/types';
import metadata from './metadata.json';

const Component = ({
href,
Expand All @@ -18,6 +19,10 @@ const Component = ({
export default {
title: 'Components/Call To Action Link With Chevron',
Component,
parameters: {
chromatic: { disable: false },
metadata,
},
};

export const Example = () => {
Expand Down
28 changes: 28 additions & 0 deletions src/app/components/CallToActionLinkWithChevron/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"lastUpdated": {
"day": 25,
"month": "March",
"year": 2025
},
"uxAccessibilityDoc": {
"done": true,
"reference": {
"url": "https://paper.dropbox.com/doc/Text-CTA-below-H1-Canonical-to-Lite-Site-Screen-reader-UX--Cigs~xHuJIk9T0EHXAvQFVTRAg-AS8KipN7GULpxJldPQCoF?noDesktopRedirect=1",
"label": "Screen Reader UX"
}
},
"acceptanceCriteria": {
"done": true,
"reference": {
"url": "https://paper.dropbox.com/doc/vYAVN9JXUKmuDc71BSdw7?noDesktopRedirect=1",
"label": "Accessibility Acceptance Criteria"
}
},
"swarm": {
"done": true,
"reference": {
"url": "https://paper.dropbox.com/doc/A11Y-Swarm-Canonical-to-Lite-Site-CTA--CiyQ0JQgBqyy~VQKnriUNwkeAg-61ABYtPk5Vozk84r8ou82",
"label": "Accessibility Swarm"
}
}
}
2 changes: 1 addition & 1 deletion src/app/hooks/useClickTrackerHandler/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ describe('useClickTrackerHandler', () => {
'myEvent_clicks',
mockUserId,
{
clicked_wsoj: true,
'clicked_canonical-lite-cta': true,
foo: 'bar',
},
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/hooks/useOptimizelyVariation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useState, useEffect } from 'react';
import { useDecision } from '@optimizely/react-sdk';

const isClientSide = false;
const isClientSide = true;

// ALTHOUGH THIS FUNCTION BREAKS REACT RULES BY USING CONDITIONAL HOOKS,
// WE CAN SAFELY DO SO SINCE isClientSide IS A CONSTANT AND THEREFORE GUARANTEES THAT
Expand Down
2 changes: 1 addition & 1 deletion src/app/hooks/useViewTracker/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ describe('useViewTracker', () => {
mockUserId,
{
foo: 'bar',
viewed_wsoj: true,
'viewed_canonical-lite-cta': true,
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ServiceContext } from '../../../../contexts/ServiceContext';
import isCypress from './isCypress';

const isInCypress = isCypress();
const TIMEOUT_INTERVAL = 5000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep an eye on CWV by changing this, it should be fine as you've mitigated with a placeholder, but would be a good thing to bare in mind.


if (isLive() || isInCypress) {
setLogger(null);
Expand Down Expand Up @@ -57,7 +58,7 @@ const withOptimizelyProvider = Component => {
<OptimizelyProvider
optimizely={optimizely}
isServerSide
timeout={1000}
timeout={TIMEOUT_INTERVAL}
user={{
id: getUserId(),
attributes: {
Expand Down
17 changes: 12 additions & 5 deletions src/app/lib/config/optimizely/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
export default {
// This is the key of the whole experiment
flagKey: 'newswb_ws_topbarojs',
flagKey: 'newswb_ws_litesitepromotion',
// This is the key for the 'rule' that is attached to the experiment
ruleKey: 'newswb_ws_topbarojs',
viewClickAttributeId: 'wsoj',
ruleKey: 'newswb_ws_litesitepromotion',
viewClickAttributeId: 'canonical-lite-cta',
variationMappings: {
on: 'on',
off: 'off',
control_text_only: 'control_text_only',
variation_a_explore_data_friendly_version:
'variation_a_explore_data_friendly_version',
variation_b_data_saving_version: 'variation_b_data_saving_version',
variation_c_read_data_saving_version:
'variation_c_read_data_saving_version',
variation_d_lite_site: 'variation_d_lite_site',
variation_e_2g_optimised_version: 'variation_e_2g_optimised_version',
variation_f_low_data_version: 'variation_f_low_data_version',
},
};
11 changes: 11 additions & 0 deletions src/app/lib/config/services/gahuza.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ export const service: DefaultServiceConfig = {
informationPageLink: 'https://www.bbc.com/gahuza/articles/cn7y7pvem0vo',
dataSaving: 'Ahagusaba uburyo (ama mega) buke',
articleDataSavingLinkText: 'Nyandiko gusa',
experiment: {
control_text_only: 'Nyandiko gusa',
variation_a_explore_data_friendly_version:
'Koresha uburyo butwara amahera make',
variation_b_data_saving_version: 'Uburyo buziganya amahera',
variation_c_read_data_saving_version:
'Soma mu buryo biziganya amahera',
variation_d_lite_site: 'Site yoroheje',
variation_e_2g_optimised_version: '2G Ukoresheje uburyo busanzwe',
variation_f_low_data_version: 'Uburyo butwara amahera make',
},
},
mediaAssetPage: {
mediaPlayer: 'Ibikinwa',
Expand Down
1 change: 1 addition & 0 deletions src/app/models/types/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface Translations {
informationPageLink: string;
dataSaving: string;
articleDataSavingLinkText: string;
experiment?: Record<string, string>;
};
mediaAssetPage: {
mediaPlayer: string;
Expand Down
Loading
Loading