Skip to main content
Use this API to create and manage A/B tests. For an introduction to A/B testing concepts, see the A/B test workflows documentation. All requests require a bearer token in the Authorization header. See Get Started with Confidence APIs for how to obtain one using your client ID and secret.

Get an A/B Test

Retrieve a specific A/B test by its name to view its configuration and current state.
Response:

List A/B Tests

List all A/B tests in your account. You can filter by state or any other criteria in the response. Use nextPageToken for getting the next page of results.
Response:

Create an A/B Test

Create a new A/B test with treatments and metrics configuration.
Response:

Create an A/B Test with Exposure Filters

You can create an A/B test with exposure filters to segment your analysis by different user behaviors or contexts.
Response:

Set Targeting on an A/B Test

After creating an A/B test, call the UpdateSegment action with the desired targeting configuration. Include the updateMask field relative to segment.

Update Allocation on an A/B Test

Call the UpdateSegment action with the allocation proportion to update the traffic allocation for an A/B test.

Action Methods

Action methods return immediately with an empty result and start the action in the background. Use the GET endpoint for the A/B test to monitor the progress by inspecting the pendingTransition field.

Launch an A/B Test

End an A/B Test

Archive an A/B Test

View Results for an A/B Test

To view statistical results for your A/B test, use a two-step process.

Step 1: Get the A/B Test

First, get the A/B test to retrieve the analysisResult resource name from the stats field.
Response:
If your A/B test uses multiple exposure filters, check the stats.analysisResults[] array instead. Each entry has an analysisResult resource name and the corresponding exposureFilterName.

Step 2: Get the Analysis Result

Use the analysisResult name from Step 1 to fetch the full statistical analysis from the Analysis Results API.
Response: