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
import Abtesting

let client = try AbtestingClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY", region: .us)

let response = try await client.scheduleABTest(scheduleABTestsRequest: ScheduleABTestsRequest(
    name: "myABTest",
    variants: [
        AddABTestsVariant.abTestsVariant(AbTestsVariant(index: "AB_TEST_1", trafficPercentage: 30)),
        AddABTestsVariant.abTestsVariant(AbTestsVariant(index: "AB_TEST_2", trafficPercentage: 50)),
    ],
    scheduledAt: "2022-11-31T00:00:00.000Z",
    endAt: "2022-12-31T00:00:00.000Z"
))
Did you find this page helpful?