A/B Testing Email Campaigns: Implementation & Optimization

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
A/B Testing Email Campaigns: Implementation & Optimization
Medium
~3-5 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1362
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1253
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    958
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1190
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    931
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    949

Low open rates and stagnant click-through rates are a common pain point for email marketers. Rather than relying on intuition, A/B testing provides objective data for decision-making. Statistics show that 70% of email campaigns do not use A/B testing, missing up to 30% of potential conversions. A well-executed A/B test can increase revenue per email by 20-30% without additional traffic costs. This is confirmed by our clients' cases: one e-commerce company increased CTR by 1.8 times in three months after implementing systematic testing, generating an additional $5,000 in monthly revenue.

Properly organized testing boosts not only open rates but also audience loyalty. It's important to understand that reliable results require a sufficient sample size—at least 1,000 recipients per variant. We have implemented this practice in 50+ projects and are ready to share our experience. Statistically significant results allow confident selection of the best variant and increase conversion. A/B testing email campaigns is 2-3 times more effective than intuitive guesses when choosing a subject line.

Problems We Solve

The main mistake is testing without a plan and without adequate sample size. For example, sending 200 emails with different subject lines and declaring a winner based on 3 extra opens is statistically insignificant. Insufficient sample size is the primary cause of unreliable results. With a 20% open rate and a desired 5% effect, you need to send at least 1,300 emails per variant. Many neglect this and get false winners. Other issues include:

  • Overloading tests: trying to test 10 hypotheses in one split—compromises the experiment's purity.
  • Unaccounted external factors: day of week, time of day, seasonality.
  • Premature stopping: declaring a winner after an hour when data hasn't stabilized.

How to Properly Organize an A/B Test

The process starts with formulating a hypothesis. For example: "Personalized subject line will improve open rate by 15%." Determine the metric (open rate, CTR), choose one variable (subject line), calculate the sample size. After calculation, it's crucial to configure splitting correctly. We use random distribution with control over user segments to avoid bias. For example, if you have subscribers from different regions, ensure they are evenly distributed among variants. Then set up the split system:

interface ABTestVariant {
  id: 'A' | 'B' | 'C';
  subject: string;
  templateId: string;
  weight: number;  // traffic share, e.g., 0.5 for 50/50
}

interface ABTest {
  id: string;
  campaignId: string;
  variants: ABTestVariant[];
  winnerMetric: 'open_rate' | 'click_rate';
  sampleSize: number;       // how many to send for test
  winnerSendAt?: Date;      // when to send winner to the rest
}

async function sendABTest(test: ABTest, users: User[]) {
  // Shuffle users randomly
  const shuffled = users.sort(() => Math.random() - 0.5);

  // Divide into groups according to weights
  let offset = 0;
  for (const variant of test.variants) {
    const count = Math.floor(test.sampleSize * variant.weight);
    const group = shuffled.slice(offset, offset + count);
    offset += count;

    await Promise.allSettled(
      group.map(user =>
        sendVariantEmail(user, variant, test.id)
      )
    );
  }

  // Save test information
  await db.abTests.create(test);

  // Schedule winner selection
  if (test.winnerSendAt) {
    await scheduleWinnerSelection(test.id, test.winnerSendAt);
  }
}

async function sendVariantEmail(user: User, variant: ABTestVariant, testId: string) {
  const html = await renderTemplate(variant.templateId, { user });
  const emailLogId = await sendEmail({
    to: user.email,
    subject: variant.subject,
    html,
  });

  await db.abTestParticipants.create({
    testId,
    variantId: variant.id,
    userId: user.id,
    emailLogId,
  });
}
More on Sample Size Calculation

To calculate the minimum sample size, use the formula: n = (Z^2 * p * (1-p)) / d^2, where Z=1.96 for a 95% confidence interval, p is the expected open rate, and d is the minimum detectable effect. For example, with p=25% and d=5%, you need about 1,200 recipients per variant.

What to Do If Results Are Not Statistically Significant

After collecting data, run a winner determination script:

async function determineWinner(testId: string): Promise<'A' | 'B' | 'C'> {
  const test = await db.abTests.findById(testId);

  const stats = await db.query<{
    variant_id: string;
    sent: number;
    opened: number;
    clicked: number;
  }>(`
    SELECT
      p.variant_id,
      COUNT(DISTINCT p.id) AS sent,
      COUNT(DISTINCT oe.email_log_id) AS opened,
      COUNT(DISTINCT ce.email_log_id) AS clicked
    FROM ab_test_participants p
    LEFT JOIN email_open_events oe ON oe.email_log_id = p.email_log_id
    LEFT JOIN email_click_events ce ON ce.email_log_id = p.email_log_id
    WHERE p.test_id = $1
    GROUP BY p.variant_id
  `, [testId]);

  const withRates = stats.map(s => ({
    ...s,
    open_rate: s.opened / s.sent,
    click_rate: s.clicked / s.sent,
  }));

  // Check statistical significance (z-test for proportions)
  const winner = withRates.reduce((best, current) => {
    const metric = test.winnerMetric === 'open_rate' ? 'open_rate' : 'click_rate';
    return current[metric] > best[metric] ? current : best;
  });

  return winner.variant_id as 'A' | 'B' | 'C';
}

// Send winner to remaining users
async function sendWinnerToRemainder(testId: string) {
  const winnerId = await determineWinner(testId);
  const test = await db.abTests.findById(testId);
  const winnerVariant = test.variants.find(v => v.id === winnerId)!;

  // Users not in test
  const participantIds = await db.abTestParticipants.getUserIdsByTest(testId);
  const remainderUsers = await db.users.findExcluding(participantIds, test.campaignId);

  await Promise.allSettled(
    remainderUsers.map(user =>
      sendVariantEmail(user, winnerVariant, testId)
    )
  );
}

Key point: check statistical significance. Use a z-test for proportions. If p-value > 0.05, no winner is declared. In such cases, extend the test or revisit the hypothesis.

Metric Formula Example for Group A (n=1000)
Open rate opened / sent 250/1000 = 25%
Click rate clicked / sent 50/1000 = 5%
Statistical significance z-test z > 1.96 → significant
Stage Duration
Analytics & Hypotheses 1–2 days
Split system development 3–5 days
Pilot test 1–2 days
Deployment & training 1–2 days

What's Included in Our Work

  • Audit of current campaigns and hypothesis formulation.
  • Development of a split system with integrated metric collection.
  • Configuration of automatic winner determination and remainder sending.
  • Documentation on result interpretation.
  • Post-implementation support for 1 month.

Process

  1. Analytics – review your email statistics, identify bottlenecks.
  2. Design – select variables, calculate sample size, set up tracking.
  3. Implementation – write split system code, integrate with your platform.
  4. Testing – run a pilot test, verify logic.
  5. Deployment – go live, train your team.

The cost of implementation depends on the current infrastructure and the number of parallel tests. We conduct a preliminary audit and provide an exact figure.

Timeline and Results

Average implementation time: 5 to 10 days, depending on integration complexity. Within that time, you get:

  • A working A/B testing system.
  • First statistically significant results.
  • Recommendations for further optimization.

The investment in A/B testing pays for itself within the first month. Contact us for a consultation about your project. We guarantee a professional approach and transparent reporting.

Our team has 5+ years of experience in email marketing, with 50+ A/B tests implemented. Our specialists are certified in popular ESPs.

According to a Campaign Monitor study, personalization boosts open rates by 26%. A/B testing can improve open rates by 20-30% compared to uniform sends. Order A/B testing implementation and get first results within a week.

Email Campaign Integration: Why Does It Often Break?

We’ve observed that a trigger email sent 10 minutes after registration converts 4–5 times better than the same email sent after 24 hours. This isn’t a marketing myth—it’s mechanics: while the user is still warm, while they remember the context. But most integrations with email services are built like this: form submits → synchronous HTTP request to API → if the API is slow, the user waits 3 seconds → the email either goes out or doesn’t, nobody knows. In one project, we saw a 30% drop in conversion simply because the email service responded with 504 and Laravel’s queue driver wasn’t configured. Lost emails often hit customers silently – no log, no alert, just a missing order confirmation.

If you’re facing lost emails or spam folder issues, order an audit of your current integration – we’ll find bottlenecks within 2 days.

Providers and Their APIs

Unisender — a Russian provider popular in the SMB segment. REST API, simple. Adding a contact: importContacts, sending a transactional email: sendEmail. Important: for transactional emails (order confirmations, password resets), Unisender Go is a separate service with a different API and separate pricing. Mixing bulk and transactional mailings in one stream is bad for domain reputation. Unisender Go handles up to 1000 requests per second.

SendPulse — provides email, SMS, web push, Viber, and Telegram bots through a unified API. Convenient for projects requiring an omnichannel approach. Automation 360 is a visual chain builder; you can trigger automation via API events. The PHP SDK (sendpulse/rest-api-php-sdk) is maintained but updated irregularly – better to use Guzzle directly.

Mailchimp — a choice for international audiences and marketing teams accustomed to the Mailchimp ecosystem. Transactional email via Mandrill (a subsidiary service). Marketing API v3 for list, tag, and campaign management. Webhooks for opens, clicks, unsubscribes, bounces.

SMS. For Russia: SMSCenter, MTS Exolve, Devino Telecom, SMS Aero. Their APIs are similar: a send method with phone, message, sender parameters (sender name must be registered separately with the operator). One nuance: the sender name must be registered through the aggregator with a contract – otherwise SMS won’t be sent on MTS/MegaFon/Beeline networks.

Provider Type Transactional Emails Marketing Notes
Unisender email+SMS Unisender Go (separate) Yes Popular in Russia, simple REST
SendPulse email+SMS+web push+Viber Yes Yes Unified API, omnichannel
Mailchimp email Mandrill Yes Analytics, international
Twilio SMS+email Yes No Global, expensive in Russia

How to Build an Integration That Doesn’t Lose Emails?

Separate Transactional and Marketing Streams

Transactional emails (order confirmations, password resets, delivery status) go through a dedicated sender domain or subdomain tx.example.com. Marketing campaigns go through mail.example.com or news.example.com. If a marketing campaign receives many spam complaints, it should not affect the reputation of the transactional stream. According to SendGrid documentation, transactional messages should be sent through a dedicated IP pool to prevent cross-contamination.

Queue and Retry

Any call to the email API goes through a queue (Laravel Queue, Bull, Celery). If Unisender returns a 503, the job retries after 5 minutes, then 15, then 60. After 5 failed attempts, it goes to a dead letter queue with an alert. The user already received their 200 OK and knows nothing about the issue. This approach reduces bounce rate on projects to 0.5%.

Example Laravel job:

public function handle(): void
{
    try {
        $response = Http::post(config('services.unisender.email_url'), $this->params);
        if ($response->failed()) {
            $this->release(300); // retry after 5 min
        }
    } catch (\Throwable $e) {
        $this->release(300);
    }
}

Templates

We store templates in code (Blade, Twig, React Email), not in the provider’s interface. Reasons: versioning via Git, browser preview without sending, testability. For complex templates with dynamic content — react-email with export to HTML via @react-email/render.

Validation and Consent

Before adding a contact to a list — double opt-in (confirmation email). Store the confirmation timestamp in your own database. Upon unsubscription — synchronously unsubscribe both at the provider and in your database. Ignoring webhook unsubscriptions is a direct path to account suspension at the provider. All processes comply with Федеральный закон № 152-ФЗ «О персональных данных».

Deliverability Monitoring and DKIM Setup

Connect provider webhooks for events: bounce (hard and soft), spam_complaint, unsubscribe. Hard bounce — immediately mark the email as invalid in your database, stop sending. Soft bounce 3 times in a row — same. Metrics: open rate, click rate, bounce rate, unsubscribe rate — review at least once a week. Our certified engineers configure alerts in Grafana/Prometheus.

DKIM configuration steps:

  1. Generate a key pair (e.g., openssl genrsa -out private.key 2048).
  2. Publish the public key in DNS as a TXT record for the selector (e.g., mail._domainkey.tx.example.com).
  3. Provide the selector to the provider (SendGrid, Mailgun, Unisender).
  4. Verify with dig TXT mail._domainkey.tx.example.com.

SPF, DKIM, DMARC must be configured separately for each stream. We use subdomains with different DNS records.

Why Is It Important to Separate Streams?

If you send a marketing campaign from the same domain as transactional emails and receive spam complaints, you risk getting the domain blocked — and users will stop receiving even order confirmations. SPF, DKIM, DMARC (Sender Policy Framework, DomainKeys Identified Mail, Domain‑based Message Authentication, Reporting and Conformance) must be configured separately for each stream. In one project, a marketing blast with 12% spam complaints blocked the transactional domain for 48 hours — we had to re‑authenticate with Google and Yandex.

What Does the Integration Scope Include?

  • Audit of current communication streams and domain reputation (SPF, DKIM, DMARC)
  • Provider and schema selection: transactional vs marketing traffic
  • Configuration of SPF, DKIM, DMARC DNS records
  • Development of email templates (HTML + dynamic content)
  • Backend integration via queues and API
  • Webhook setup for deliverability and complaints
  • Operations documentation and team training
  • Deliverability guarantee and post‑launch support

We deliver production‑ready documentation, access to monitoring dashboards, and a handover session with your engineers. Our certified engineers provide a 30‑day post‑launch health check guarantee.

Timelines and Cost

Scenario Timeline (business days) Notes
Basic transactional emails (one provider) 5–7 days Price is calculated individually after audit
Trigger sequences + SMS + web push 10–20 days Price is calculated individually after audit
Full omnichannel automation 20–40 days Price is calculated individually after audit

Cost is calculated individually after audit. We provide turnkey service: from analysis to production monitoring. Contact us for a free engineer consultation — we’ll evaluate your project and give accurate timelines. Over 7 years of experience in email service integration, 50+ projects implemented. Order a free audit of your current integration and receive a report with recommendations and estimated savings.