Add A/B test for in-article newsletter signup with no preview variant#16380
Conversation
93f4664 to
e370919
Compare
There was a problem hiding this comment.
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 inab-testing/config/abTests.ts. - Threads
abTestmetadata into newsletter signup tracking (VIEW + interactions) and addsenablePreviewto disable preview UI in thewithout-previewarm. - 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.
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Seen on PROD (merged by @georgerichmond 12 minutes and 23 seconds ago) Please check your changes! |
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 intactwithout-preview– identical toillustratedexcept the Preview button is removed and the preview modal cannot be openedThe A/B test variant is threaded through to:
NewsletterSignupCardContainervia anenablePreviewprop (disabling the preview button and modal inwithout-preview)NewsletterSignupFormand the OphanVIEWevent via anabTestprop, so all newsletter signup tracking is attributed to the correct armillustratedarmA small resilience improvement is also included: the
VIEWevent 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-previewalongsideillustratedwe can measure whether removing the Preview CTA improves newsletter subscription rates.Screenshots