An A/B test is a method of comparing templates to see which performs best. Each A/B test has a default template and up to 20 template variants to compare. You can configure whether we compare the templates based on the number of unique opens or unique clicks.
You can also choose how many messages use each variant in one of two ways:
A percentage of messages
A fixed number of messages
The test will then run until one of the following criteria is met:
The end_time
passes
The number of messages accepted equals or exceeds the total_sample_size
The confidence_level
has been reached (Bayesian Mode only)
To use the A/B test, send it as the transmission content. Learn more about sending an A/B test.
Once the test ends, we wait the number of hours set in engagement_timeout
before marking the test completed. This gives time for the metrics to come in from the emails that were last sent.
The test_mode
defines what happens once the A/B test completes. In learning
mode, once the test completes all future transmissions use the default template. In bayesian
mode, we use a Bayesian algorithm to determined the best performing template. and use that winning template for future transmissions.
In Bayesian mode, when a template reaches the set confidence_level
it becomes the winner. If a test ends by hitting one of the other conditions and the confidence_level
has not been reached, the default template will be considered the winner.
A/B Tests only support single recipient transmissions currently
A/B test versions allow you to run multiple tests within the same A/B test. This lets you iterate without changing your transmissions call. The version increments each time the A/B test is updated after its first completed or cancelled run.
{
"id": "password-reset",
"name": "Password Reset",
"version": 2,
"status": "scheduled",
"metric": "count_unique_confirmed_opened",
"audience_selection": "sample_size",
"start_time": "2018-04-03T22:08:33+00:00",
"test_mode": "bayesian",
"confidence_level": 0.99,
"total_sample_size": 60000,
"engagement_timeout": 24,
"default_template": {
"template_id": "default_password_reset_template",
"sample_size": 20000
},
"variants": [
{
"template_id": "password_reset_variant1",
"sample_size": 20000
},
{
"template_id": "password_reset_variant2",
"sample_size": 20000
}
],
"created_at": "2018-04-02T22:08:33+00:00",
"updated_at": "2018-04-02T22:08:33+00:00"
}
Unique alphanumeric ID.
Display name.
The current state of the test.
Possible Values: draft
, scheduled
, running
, completed
, cancelled
The winner of the A/B test. Only present when the state is completed
.
The current version of the test.
Details for the default template. See Template Object.
Specifies which variants to test, as well as how messages are distributed to each variant. See Template Object.
Which metric to use when comparing the templates.
Possible Values: count_unique_clicked
, count_unique_confirmed_opened
Determines how to distribute messages for templates. Each template will receive either a percent of the total of all messages or a set number of messages.
Possible Values: sample_size
, percent
Possible Values: bayesian
, learning
ISO Date specifying when the test should begin.
ISO Date specifying when the test should end. Defaults to 30 days from start_time
- engagement_timeout
.
Total number of messages to send as part of the test.
Specify a confidence level at which point the test should end.
The amount of time, in hours, a test waits to collect results after the end_time
to determine the winner.
ISO Date of A/B Test creation.
ISO Date of the last time the A/B test was updated.
The template id.
The number of injections to send using this template. Required when audience_selection
is sample_size
.
The percent of injections to send using this template. Required when audience_selection
is percent
.
Read only. The number of unique clicks. Only present when the A/B test's metric
type is count_unique_clicked
.
Read only. The number of confirmed opens. Only present when the A/B test's metric
type is count_unique_confirmed_opened
.
Read only. Messages an ISP or other remote domain accepted (less Out-of-Band Bounces).
Read only. A number between 0 and 1 calculated by (count_unique_clicked
or count_unique_confirmed_opened
) / count_accepted
.
The templates must have tracking enabled for the A/B test to properly run.
POST /api/v1/ab-test
{
"id": "payment-confirmation",
"name": "Payment Confirmation",
"metric": "count_unique_confirmed_opened",
"audience_selection": "percent",
"start_time": "2018-04-03T22:08:33Z",
"test_mode": "bayesian",
"confidence_level": 0.99,
"default_template": {
"template_id": "default_payment_confirmation_template",
"percent": 50
},
"variants": [
{
"template_id": "payment_confirmation_variant1",
"percent": 25
},
{
"template_id": "payment_confirmation_variant2",
"percent": 25
}
]
}
{
"results": {
"id": "payment-confirmation"
}
}
POST /api/v1/ab-test
{
"id": "payment-confirmation",
"name": "Payment Confirmation",
"metric": "count_unique_confirmed_opened",
"audience_selection": "sample_size",
"start_time": "2018-04-03T22:08:33+00:00",
"test_mode": "learning",
"total_sample_size": 60000,
"default_template": {
"template_id": "default_payment_confirmation_template",
"sample_size": 40000
},
"variants": [
{
"template_id": "payment_confirmation_variant1",
"sample_size": 10000
},
{
"template_id": "payment_confirmation_variant2",
"sample_size": 10000
}
]
}
{
"results": {
"id": "payment-confirmation"
}
}
Unique alphanumeric ID used to reference the A/B test. It is auto-generated from the name
, if not provided.
Display name.
Details for the default template. See Template Object.
Specifies which variants to test, as well as how messages are distributed to each variant. See Template Object.
Which metric to use when comparing the templates.
Possible Values: count_unique_clicked
, count_unique_confirmed_opened
Determines how to distribute messages for templates. Each template will receive either a percent of the total of all messages or a set number of messages.
Possible Values: percent
, sample_size
Possible Values: bayesian
, learning
ISO Date specifying when the test should begin.
ISO Date specifying when the test should end. Defaults to 30 days from start_time
- engagement_timeout
.
Total number of messages to send as part of the test.
0.95
Specify a confidence level at which point the test should end.
24
The amount of time, in hours, a test waits to collect results after the end_time
to determine the winner.
Returns the A/B test ID, when successful.
GET /api/v1/ab-test/password-reset
{
"results": {
"id": "password-reset",
"name": "Password Reset",
"version": 2,
"status": "scheduled",
"metric": "count_unique_confirmed_opened",
"audience_selection": "sample_size",
"start_time": "2018-04-03T22:08:33+00:00",
"test_mode": "bayesian",
"confidence_level": 0.99,
"total_sample_size": 60000,
"engagement_timeout": 24,
"default_template": {
"template_id": "default_password_reset_template",
"sample_size": 20000,
"count_unique_confirmed_opened": 1398,
"count_accepted": 20321,
"engagement_rate": 0.068795
},
"variants": [
{
"template_id": "password_reset_variant1",
"sample_size": 20000,
"count_unique_confirmed_opened": 343,
"count_accepted": 18908,
"engagement_rate": 0.01814
},
{
"template_id": "password_reset_variant2",
"sample_size": 20000,
"count_unique_confirmed_opened": 890,
"count_accepted": 22987,
"engagement_rate": 0.038717
}
],
"created_at": "2018-04-02T22:08:33+00:00",
"updated_at": "2018-04-02T22:08:33+00:00"
}
}
If passed, returns information about the specific version of the A/B test. If not specified, returns information about the latest version.
PUT /api/v1/ab-test/password-reset
{
"total_sample_size": 100000,
"default_template": {
"template_id": "default_password_reset_template",
"sample_size": 70000
},
"variants": [
{
"template_id": "password_reset_variant1",
"sample_size": 10000
},
{
"template_id": "password_reset_variant2",
"sample_size": 20000
}
]
}
{
"results": {
"version": 2
}
}
You can not update an A/B test while it is running
. Tests in running
state must be cancelled before updating.
If the A/B test's latest version is cancelled or completed, updating it creates a new version, effectively restarting the test. The winning_template_id
will be reset for the new version. If winning_template_id
existed in the previous version, the default_tempate.template_id
of the new version will default to that value, unless overridden by the update.
Display name.
Details for the default template. See Template Object.
Specifies which variants to test, as well as how messages are distributed to each variant. See Template Object.
Which metric to use when comparing the templates.
Possible Values: count_unique_clicked
, count_unique_confirmed_opened
Determines how to distribute messages for templates. Each template will receive either a percent of the total of all messages or a set number of messages.
Possible Values: percent
, sample_size
Possible Values: bayesian
, learning
ISO Date specifying when the test should begin.
ISO Date specifying when the test should end. Defaults to 30 days from start_time
- engagement_timeout
.
Total number of messages to send as part of the test.
0.95
Specify a confidence level at which point the test should end.
24
The amount of time, in hours, a test waits to collect results after the end_time
to determine the winner.
Returns the new version
.
POST /api/v1/ab-test/password-reset/cancel
{
"results": {
"status": "cancelled"
}
}
Any transmissions using this A/B test will send the default_template
.
Returns the status
.
DELETE /api/ab-test/password-reset
// Empty response body
GET /api/v1/ab-test?status=completed
{
"results": [
{
"id": "payment-confirmation",
"name": "Payment Confirmation",
"version": 2,
"status": "running",
"metric": "count_unique_confirmed_opened",
"audience_selection": "percent",
"start_time": "2018-04-03T22:08:33+00:00",
"test_mode": "bayesian",
"confidence_level": 0.99,
"engagement_timeout": 24,
"default_template": {
"template_id": "default_payment_confirmation_template",
"percent": 60,
"count_unique_confirmed_opened": 1000,
"count_accepted": 100000,
"engagement_rate": 0.01
},
"variants": [
{
"template_id": "payment_confirmation_variant1",
"percent": 10,
"count_unique_confirmed_opened": 489,
"count_accepted": 9000,
"engagement_rate": 0.054333
},
{
"template_id": "payment_confirmation_variant2",
"percent": 30,
"count_unique_confirmed_opened": 320,
"count_accepted": 68933,
"engagement_rate": 0.004642
}
],
"created_at": "2018-04-02T22:08:33+00:00",
"updated_at": "2018-04-02T22:08:33+00:00"
},
{
"id": "password-reset",
"name": "Password Reset",
"version": 2,
"status": "completed",
"winning_template_id": "password_reset_variant2",
"metric": "count_unique_clicked",
"audience_selection": "percent",
"start_time": "2018-04-03T22:08:33+00:00",
"test_mode": "bayesian",
"confidence_level": 0.99,
"engagement_timeout": 24,
"default_template": {
"template_id": "default_password_reset_template",
"percent": 70,
"count_unique_clicked": 8909,
"count_accepted": 3423230,
"engagement_rate": 0.002602
},
"variants": [
{
"template_id": "password_reset_variant1",
"percent": 15,
"count_unique_clicked": 398,
"count_accepted": 90302,
"engagement_rate": 0.004407
},
{
"template_id": "password_reset_variant2",
"percent": 15,
"count_unique_clicked": 231,
"count_accepted": 73039,
"engagement_rate": 0.003162
}
],
"created_at": "2018-04-02T22:08:33+00:00",
"updated_at": "2018-04-02T22:08:33+00:00"
}
]
}
If provided, filters the list of A/B tests returned by the provided status. Available options are: draft, scheduled, running, cancelled, completed.
Returns an array of latest versions of your A/B tests.
A/B Test drafts allow you to build a A/B test in a series of steps instead of all at once.
POST /api/v1/ab-test/draft
{
"id": "payment-confirmation",
"name": "Payment Confirmation",
"default_template": {
"template_id": "default_payment_confirmation_template",
"percent": 50
}
}
{
"results": {
"id": "payment-confirmation"
}
}
Unique alphanumeric ID used to reference the A/B test. It is auto-generated from the name
, if not provided.
Display name.
Details for the default template. See Template Object.
GET /api/v1/ab-test/draft/my-draft-test
{
"results": {
"id": "my-draft-test",
"name": "my draft",
"version": 1,
"status": "draft",
"default_template": {
"template_id": "my-test-temp",
"percent": 50
},
"created_at": "2018-07-10T21:55:34.960Z",
"updated_at": "2018-07-11T21:55:47.176Z"
}
}
PUT /api/v1/ab-test/draft/payment-confirmation
{
"metric": "count_unique_confirmed_opened",
"audience_selection": "percent",
"test_mode": "bayesian",
"confidence_level": 0.99,
"variants": [
{
"template_id": "payment_confirmation_variant1",
"percent": 25
},
{
"template_id": "payment_confirmation_variant2",
"percent": 25
}
]
}
{
"results": {
"id": "payment-confirmation"
}
}
Display name.
Details for the default template. See Template Object.
Specifies which variants to test, as well as how messages are distributed to each variant. See Template Object.
Which metric to use when comparing the templates.
Possible Values: count_unique_clicked
, count_unique_confirmed_opened
Determines how to distribute messages for templates. Each template will receive either a percent of the total of all messages or a set number of messages.
Possible Values: percent
, sample_size
Possible Values: bayesian
, learning
ISO Date specifying when the test should begin.
ISO Date specifying when the test should end. Defaults to 30 days from start_time
- engagement_timeout
.
Total number of messages to send as part of the test.
0.95
Specify a confidence level at which point the test should end.
24
The amount of time, in hours, a test waits to collect results after the end_time
to determine the winner.
Returns the A/B test ID.
DELETE /api/ab-test/draft/password-reset
// Empty response body
POST /api/v1/ab-test/draft/payment-confirmation/schedule
{
"start_time": "2018-04-03T22:08:33+00:00",
"end_time": "2018-04-15T22:08:33+00:00",
"engagement_timeout": 4
}
{
"results": {
"id": "payment-confirmation"
}
}
ISO Date specifying when the test should begin.
ISO Date specifying when the test should end. Defaults to 30 days from start_time
- engagement_timeout
.
24
The amount of time, in hours, a test waits to collect results after the end_time
to determine the winner.