Get A/B Test Results
You can get data about an A/B test during the experiment or after it has concluded.
For a specific test
To get data about a specific A/B test, send a
GET
request to the
/AB_TEST_ID
enpoint where
AB_TEST_ID
is the ID for the test you are interested in.
curl -i -X GET "https://graph.facebook.com/
AB_TEST_ID
"
On success your app will receive a JSON response with details about the experiment such as the name, goal, IDs for the videos, published status, videos insights for each test video, and a declaration for which video performed the best. In the example here, EXPERIMENTAL_VIDEO_ID_1 performed the best.
{
"id": YOUR_AB_TEST_ID,
"name": "YOUR_AB_TEST_NAME",
"description": "YOUR_AB_TEST_DESCRIPTION",
"optimization_goal": "REELS_PLAYS",
"experiment_video_ids": [YOUR_EXPERIMENTAL_VIDEO_ID_1, YOUR_EXPERIMENTAL_VIDEO_ID_2],
"control_video_id": VIDEO_ID_1_AS_CONTROL,
"publish_status": "LIVE",
"creation_time": "1686665092",
"updated_time": "1686665092",
"scheduled_experiment_timestamp": "1686665092",
"test_insights": {
"timestamp": "1686665092",
"videos": {
YOUR_EXPERIMENTAL_VIDEO_ID_1: {
"plays": 10,
"impressions": 1,
"fan_impressions": 1,
"link_clicks": 1,
"comments": 1,
"shares": 1,
"reactions": 1,
"video_views_60s": 1,
"video_views_3s": 1,
"video_views_15s": 1,
"avg_video_views": 1,
"video_views": 1,
"instream_ads_earnings": 1,
"avg_time_watched": 1,
"video_retention_graph": {
"0": 1,
"1": 1,
"2": 0.5,
"3": 0.2
}
}
YOUR_EXPERIMENTAL_VIDEO_ID_2: {
"plays": 5,
"impressions": 1,
"fan_impressions": 1,
"link_clicks": 1,
"comments": 0,
"shares": 0,
"reactions": 1,
"video_views_60s": 1,
"video_views_3s": 1,
"video_views_15s": 1,
"avg_video_views": 1,
"video_views": 1,
"instream_ads_earnings": 0,
"avg_time_watched": 1,
"video_retention_graph": {
"0": 1,
"1": 1,
"2": 0.5,
"3": 0.2
}
}
},
"declared_winning_video": YOUR_EXPERIMENTAL_VIDEO_ID_1,
}
}
For All Tests on a Page
To get a list of all A/B tests conducted on your Facebook Page, send a
GET
request to the
/***PAGE***/ab_tests
endpoint where
PAGE
is the ID for the Page you are interested in. Add the
since
and
unti
parameters to get data for tests run during a specific time period.
Note:
When using the
since
and
until
parameters in your
GET
request, the date for
until
must be a date after the date for
since
. For example, if
since
is 2023-01-31,
until
must be after 2023-01-31. You can use both parameters, or one or the other. Date formats can be any of the following:
curl -X GET "https://graph.facebook.com/
v19.0
/
PAGE
/ab_tests"
On success your app receives a JSON response with an array of test objects.
{
"data": [
... {AB_TEST_RESPONSE_OBJECT_1},
... {AB_TEST_RESPONSE_OBJECT_2},
... {AB_TEST_RESPONSE_OBJECT_3}
],
"cursors": {
"before":"QVFIUkxLWWtMb3BSQV91aF81NkN4c1RYczJZAQ0NQOHpQ",
"after":"QVFIUkxLWWtMb3BSQV91aF81NkN4c1RYczJZAQ0NQOH"
}
}