Skip to content

Add A/B test for in-article newsletter signup with no preview variant#16380

Merged
georgerichmond merged 8 commits into
mainfrom
952-in-article-sign-up-remove-preview-variant
Jul 15, 2026
Merged

Add A/B test for in-article newsletter signup with no preview variant#16380
georgerichmond merged 8 commits into
mainfrom
952-in-article-sign-up-remove-preview-variant

Conversation

@georgerichmond

Copy link
Copy Markdown
Contributor

What does this change?

Introduces a 2-arm A/B test (newsletters-in-article-signup-preview) for the in-article newsletter signup component:

  • illustrated – the existing experience, with the "Preview latest" CTA and modal intact
  • without-preview – identical to illustrated except the Preview button is removed and the preview modal cannot be opened

The A/B test variant is threaded through to:

  • NewsletterSignupCardContainer via an enablePreview prop (disabling the preview button and modal in without-preview)
  • NewsletterSignupForm and the Ophan VIEW event via an abTest prop, so all newsletter signup tracking is attributed to the correct arm
  • Preview-specific tracking (modal open/close events) only fires in the illustrated arm

A small resilience improvement is also included: the VIEW event now waits up to 2 seconds for the AB framework to resolve so it can attach test metadata, but will always fire eventually even if the AB framework never initialises.

Why?

Hypothesis: Including the Preview button in the variant is causing people to click it instead of subscribing, reducing conversion.

By running without-preview alongside illustrated we can measure whether removing the Preview CTA improves newsletter subscription rates.

Screenshots

Before After
before after

@georgerichmond georgerichmond added the feature Departmental tracking: work on a new feature label Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

@georgerichmond georgerichmond force-pushed the 952-in-article-sign-up-remove-preview-variant branch from 93f4664 to e370919 Compare July 14, 2026 15:50
@georgerichmond georgerichmond requested a review from Copilot July 15, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new client-side A/B test (newsletters-in-article-signup-preview) to compare the existing in-article newsletter signup experience (with “Preview latest”) vs a variant that removes the preview entry point, and threads the chosen variant through UI behavior and Ophan tracking.

Changes:

  • Introduces shared A/B test constants/helpers (newsletterSignupAbTest.ts) and registers the test in ab-testing/config/abTests.ts.
  • Threads abTest metadata into newsletter signup tracking (VIEW + interactions) and adds enablePreview to disable preview UI in the without-preview arm.
  • Adds/updates unit tests to validate AB metadata forwarding, preview disabling, and the VIEW-event timeout fallback.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
dotcom-rendering/src/lib/newsletterSignupAbTest.ts New helper module defining test name/variants and resolving Ophan abTest metadata.
dotcom-rendering/src/components/NewsletterSignupForm.island.test.tsx Adds coverage to ensure AB metadata is forwarded into tracking payloads.
dotcom-rendering/src/components/NewsletterSignupCardContainer.tsx Adds abTest threading for preview tracking and enablePreview to gate preview UI.
dotcom-rendering/src/components/NewsletterSignupCardContainer.test.tsx Verifies preview tracking includes AB metadata and that preview UI is omitted when disabled.
dotcom-rendering/src/components/EmailSignUpWrapper.island.tsx Reads AB participation, controls preview enablement, and delays VIEW event up to 2s for AB resolution.
dotcom-rendering/src/components/EmailSignUpWrapper.island.test.tsx Adds tests for AB metadata propagation and the VIEW-event timeout fallback.
ab-testing/config/abTests.ts Registers the new A/B test and its groups/metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dotcom-rendering/src/components/EmailSignUpWrapper.island.test.tsx
@georgerichmond georgerichmond marked this pull request as ready for review July 15, 2026 11:45
@georgerichmond georgerichmond requested a review from a team as a code owner July 15, 2026 11:45
@github-actions

Copy link
Copy Markdown

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

georgerichmond and others added 2 commits July 15, 2026 12:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@georgerichmond georgerichmond added the run_chromatic Runs chromatic when label is applied label Jul 15, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 15, 2026
@georgerichmond georgerichmond added the run_chromatic Runs chromatic when label is applied label Jul 15, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 15, 2026
@georgerichmond georgerichmond merged commit 5f85626 into main Jul 15, 2026
30 checks passed
@georgerichmond georgerichmond deleted the 952-in-article-sign-up-remove-preview-variant branch July 15, 2026 15:07
@gu-prout

gu-prout Bot commented Jul 15, 2026

Copy link
Copy Markdown

Seen on PROD (merged by @georgerichmond 12 minutes and 23 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants