Skip to content

feat(campaign): add campaign A/B testing tools for headlines and images - #1302

Open
devogechukwu wants to merge 2 commits into
Fundable-Protocol:mainfrom
devogechukwu:feat/campaign-ab-testing-tools
Open

devogechukwu wants to merge 2 commits into
Fundable-Protocol:mainfrom
devogechukwu:feat/campaign-ab-testing-tools

Conversation

@devogechukwu

Copy link
Copy Markdown

Summary

This pull request implements comprehensive campaign A/B testing tools enabling creators to configure, preview, test, and optimize campaign headlines, hero images, and CTA button text to identify which variants drive higher conversion rates.

Acceptance Criteria Implemented

  • Creator sets up variants in campaign editor:

    • Implemented CampaignABTestingEditor component integrated into:
      • CampaignEditModal under a dedicated "A/B Testing Tools" tab.
      • CampaignWizardSteps inside the initial DetailsStep during campaign creation.
    • Creators can define Variant A (Control) and Variant B (or additional test variants) specifying:
      • Campaign headline text
      • Hero image URL with live thumbnail and preview
      • CTA button text
    • Live visitor preview demonstrates the exact rendering of each variant.
  • Traffic split 50/50 by default (configurable):

    • Initialized with an automatic 50/50 balanced split across variants.
    • Interactive percentage sliders and controls allow creators to customize traffic splits (e.g. 70/30, 80/20), validating that total traffic allocation equals 100%.
  • Winner can be locked in manually or auto-selected by significance:

    • Manual winner locking: Creators can lock in any winning variant with a single click, instantly routing 100% of future visitors to the winner.
    • Auto-selection by statistical significance: Integrated two-proportion z-test calculation computing z-scores, p-values, and confidence levels ((p < 0.05) / 95% confidence threshold with a minimum sample size requirement).
    • When winner selection mode is set to significance, the system automatically identifies and locks in the winning variant upon reaching statistical significance.

Key Changes

  • apps/web/src/types/campaign-ab-testing.ts: Type definitions for variants, traffic splits, statistical significance metrics, and test configuration.
  • apps/web/src/services/campaign-ab-testing.service.ts: Core domain service handling variant routing, impression tracking, conversion tracking, winner locking, and two-proportion z-test calculations.
  • apps/web/src/hooks/use-campaign-ab-testing.ts: Deterministic client hook for variant routing, impression recording, and conversion event tracking.
  • apps/web/src/components/modules/campaign/ab-testing/: Creator UI with variant inputs, traffic split sliders, live preview cards, and statistical significance badges.

Closes #1221

@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@devogechukwu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bb85a477-70c7-4bf0-9f51-d98a0ea213bd
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create campaign A/B testing tools for headlines and images

1 participant