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

WSTEAM1-1312 Run an Optimizely AA Test #12017

Merged
merged 11 commits into from
Oct 1, 2024
12 changes: 11 additions & 1 deletion src/app/pages/ArticlePage/ArticlePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import CpsRecommendations from '#containers/CpsRecommendations';
import InlinePodcastPromo from '#containers/PodcastPromo/Inline';
import { Article, OptimoBylineBlock } from '#app/models/types/optimo';

import useOptimizelyVariation from '#app/hooks/useOptimizelyVariation';
import ImageWithCaption from '../../components/ImageWithCaption';
import AdContainer from '../../components/Ad';
import EmbedImages from '../../components/Embeds/EmbedImages';
Expand Down Expand Up @@ -133,6 +134,10 @@ const ArticlePage = ({ pageData }: { pageData: Article }) => {
...(isCPS && { pageTitle: `${atiAnalytics.pageTitle} - ${brandName}` }),
};

const scrollablePromoVariation = useOptimizelyVariation(
'scrollable_promo',
) as unknown as string;
emilysaffron marked this conversation as resolved.
Show resolved Hide resolved

const componentsToRender = {
visuallyHiddenHeadline,
headline: headings,
Expand Down Expand Up @@ -166,7 +171,12 @@ const ArticlePage = ({ pageData }: { pageData: Article }) => {
embedImages: EmbedImages,
embedUploader: Uploader,
group: gist,
links: (props: ComponentToRenderProps) => <ScrollablePromo {...props} />,
links: (props: ComponentToRenderProps) =>
scrollablePromoVariation === 'variation_1_aa' ? (
<ScrollablePromo {...props} />
) : (
<ScrollablePromo {...props} />
),
karinathomasbbc marked this conversation as resolved.
Show resolved Hide resolved
mpu: (props: ComponentToRenderProps) =>
allowAdvertising ? <AdContainer {...props} slotType="mpu" /> : null,
wsoj: (props: ComponentToRenderProps) => (
Expand Down
5 changes: 4 additions & 1 deletion src/app/pages/ArticlePage/index.tsx
emilysaffron marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import withOptimizelyProvider from '#app/legacy/containers/PageHandlers/withOptimizelyProvider';
import ArticlePage from './ArticlePage';
import applyBasicPageHandlers from '../utils/applyBasicPageHandlers';

export default applyBasicPageHandlers(ArticlePage);
const OptimizelyArticle = withOptimizelyProvider(ArticlePage);

export default applyBasicPageHandlers(OptimizelyArticle);
Loading