A/B Testing and Multischeduling
React Bricks v5 introduces variants for pages. Variants can be used for multischeduling and A/B testing.
With variants, you can prepare multiple versions of the same page and decide when each one should be active. When more than one variant is active at the same time, React Bricks can serve them according to the weights you configure.
Multischeduling
Section titled “Multischeduling”Multischeduling lets you create variants and set scheduled publish and unpublish dates for each variant.
This is useful when a page needs to change across a campaign timeline, for example:
- a teaser before a launch
- a launch-day version
- a post-launch version
- a seasonal promotion with a fixed end date
Each variant has its own scheduling window, so editors can prepare the full sequence in advance.
A/B Testing
Section titled “A/B Testing”A/B testing uses the same variant system.
For each active variant, you can set a weight. When multiple variants are active at the same time, React Bricks serves them according to those weights.
For example:
| Variant | Weight |
|---|---|
| A | 50 |
| B | 50 |
This creates an even split. A 70 / 30 split can be configured by setting the weights accordingly.
Middleware helpers
Section titled “Middleware helpers”React Bricks provides middleware helpers to resolve the active variant for a request:
createAbTestingMiddlewarefor Next.js Pages and AstrocreateWithAbTestingMiddlewarefor Next.js App when you need to chain A/B testing with the i18n middleware
The starter projects include examples on the ab-testing branch, including middleware setup and analytics integration: see https://github.com/ReactBricks/reactbricks-starters/tree/feature/ab-testing/apps
Analytics
Section titled “Analytics”The ab-testing branch of the starter projects has an implementation example showing how to send the test name and variant name to Google Analytics.
Developer setup
Section titled “Developer setup”For the code-focused setup path, see Implement A/B Testing.