API Reference / API Methods / A/B Test / List A/B tests
Required API Key: any key with the analytics ACL
Method signature
$analytics->getABTests()
$analytics->getABTests([
  // All the following parameters are optional
  'offset' => integer,
  'limit' => integer,
])

About this method # A

We released a new version of the PHP API client in public beta. Read the beta documentation for more information.

List A/B tests information and results.

Examples # A

List all A/B test#

1
2
3
4
5
6
7
8
9
$analytics = AnalyticsClient::create(
  'AJ0P3S7DWQ',
  'YourWriteAPIKey'
);

$analytics->getABTests([
  'offset' => 10,
  'limit' => 20
]);

Parameters # A

offset #
type: integer
default: 0
Optional

Offset

limit #
type: integer
default: 10
Optional

Limit

Response # A

This section shows the JSON response returned by the API. Since each language encapsulates this response inside objects specific to that language and/or implementation, the actual type in your language might differ from what’s written here. You can view the response in the logs (using the getLogs method).

JSON format#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  "count": 1,
  "total": 1,
  "abtests": [
    {
      "abtestID": 102,
      "name": "ABTest custom name",
      "createdAt": "2018-06-04T10:25:40.459519Z",
      "endAt": "2018-06-11T23:59:59Z",
      "status": "active",
      "variants": [
        {
          "index": "scout_airports",
          "trafficPercentage": 61,
          "description": "my current scenario description",
          "searchCount": null,
          "trackedSearchCount": null,
          "userCount": null,
          "noResultCount": null,
          "clickCount": null,
          "clickThroughRate": null,
          "averageClickPosition": null,
          "conversionCount": null,
          "conversionRate": null
        },
        {
          "index": "airport_demo_airports",
          "trafficPercentage": 39,
          "description": "the test scenarios is based on locations",
          "searchCount": null,
          "trackedSearchCount": null,
          "userCount": null,
          "noResultCount": null,
          "clickCount": null,
          "clickThroughRate": null,
          "averageClickPosition": null,
          "conversionCount": null,
          "conversionRate": null
        }
      ],
      "clickSignificance": null,
      "conversionSignificance": null
    }
  ]
}
count #
integer

Number of A/B tests returned.

total #
integer

Total number of A/B tests that can be fetched.

abtests #
List of abTest

abTest #

abTestID #
integer

ID of the A/B test.

clickSignificance #
float

A/B test significance based on click data. Should be > 0.95 to be considered significant (no matter which variant is winning).

conversionSignificance #
float

A/B test significance based on conversion data. Should be > 0.95 to be considered significant (no matter which variant is winning)

createdAt #
string

Time at which the A/B test has been created. The date will be in the following format: Y-m-d\TH:i:s\Z

endAt #
string

Time at which the A/B test will automatically stop. The date will be in the following format: Y-m-d\TH:i:s\Z

name #
string

Name of the A/B test.

status #
string

Current status of the A/B test.

variants #
list of variant

List of 2 variants:

  • The base index
  • The index to test against

variants âž” variant #

clickSignificance #
float

A/B test significance based on click data. Should be > 0.95 to be considered significant (no matter which variant is winning).

conversionSignificance #
float

A/B test significance based on conversion data. Should be > 0.95 to be considered significant (no matter which variant is winning)

averageClickPosition #
int

Average click position for the variant.

clickCount #
int

Distinct click count for the variant.

clickThroughRate #
float

Click through rate for the variant.

conversionCount #
int

Distinct conversion count for the variant.

conversionRate #
float

Conversion rate for the variant.

Did you find this page helpful?
PHP v3