Schedule an A/B test

Schedule an A/B test to be started at a later time.

Usage

Required ACL: editSettings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import com.algolia.api.AbtestingClient;
import com.algolia.config.*;

AbtestingClient client = new AbtestingClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION");

client.scheduleABTest(
  new ScheduleABTestsRequest()
    .setEndAt("2022-12-31T00:00:00.000Z")
    .setScheduledAt("2022-11-31T00:00:00.000Z")
    .setName("myABTest")
    .setVariants(
      Arrays.asList(
        new AbTestsVariant().setIndex("AB_TEST_1").setTrafficPercentage(30),
        new AbTestsVariant().setIndex("AB_TEST_2").setTrafficPercentage(50)
      )
    )
);
Did you find this page helpful?