DocsOMailerA/B Split Testing
Marketing Suite

A/B Split Testing

OMailerorravo.com/docs/omailer/ab-testing

A/B Split Testing

OM_ABTest manages campaign variants. An A/B test is a parent campaign (control) plus one or more variant campaigns.

How It Works

  1. Admin creates a campaign — it becomes the control
  2. Admin creates variants with different subject lines, content, or sender name
  3. On send, OMailer splits the list: each variant gets its configured percentage; remainder goes to control
  4. After the evaluation window (configurable in hours), OMailer scores each variant by the chosen metric
  5. The winner is automatically sent to all remaining subscribers

Database Columns (on om_campaigns)

ColumnTypeNotes
ab_parent_idBIGINT UNSIGNEDID of parent/control campaign
ab_split_pctTINYINT% of list this variant receives (0–100)
ab_winner_metricENUMopen_rate or click_rate
ab_eval_hoursSMALLINTHours until winner selection
ab_statusENUMnone, control, variant, winner, loser
ab_sent_atDATETIMEWhen this variant batch was sent

PHP API

php$ab = new OM_ABTest();

// Create a variant from an existing campaign
$variant_id = $ab->create_variant(
    $parent_campaign_id,
    [
        'subject'      => 'Different subject line',
        'html_content' => '<p>Variant B content...</p>',
    ],
    30,           // split_pct: give this variant 30% of list
    'open_rate',  // winner_metric
    24            // eval_hours: pick winner after 24 hours
);

// Check if a campaign is part of an A/B test
$is_ab = $ab->is_ab_campaign( $campaign_id );  // bool

// Get all campaigns in a test
$variants = $ab->get_test_campaigns( $campaign_id );

// Manually declare winner (skips evaluation window)
$ab->evaluate( $parent_campaign_id );

Cron

OMailer checks all active A/B tests every hour via om_check_ab_tests. When ab_eval_hours has passed, it calls evaluate() which:

  1. Calculates open rate or click rate for each variant
  2. Marks the best as winner, others as loser
  3. Sends the winner to subscribers who haven't received any variant yet
A/B Split Testing — OMailer Docs — Orravo