{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Configuring A/B Testing","description":"Learn how to configure A/B testing in customer journeys using the Audience API to compare up to eight variants and optimize marketing campaigns.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"configuring-ab-testing","__idx":0},"children":["Configuring A/B Testing"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A/B testing helps marketers test treatments (for example, different marketing Calls to Action in an email) to determine which treatments are performing better. With Treasure Data's A/B Testing, you can compare one to eight versions of something to determine which performs better. To accomplish this test, at a minimum, you need one test case and a control group to validate the results. A control group is important because it provides a benchmark to measure performance against. A control group highlights what works as much as what doesn't."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"INFO"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The steps to configure A/B Testing apply only to draft journeys."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A parent segment."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A new draft journey or an existing draft journey."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic understanding of Treasure Data."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"limitations","__idx":2},"children":["Limitations"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Each stage of a journey can only have two layers of an A/B test added."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"verify-the-status-of-a-journey","__idx":3},"children":["Verify the Status of a Journey"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can verify the current status of a draft journey to which you want to add or update A/B tests. The following example does not include an A/B test because we are going to add one in this tutorial."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the case the journey included an existing A/B test, the request retrieves the name, variant, and allocation information for the specified journey."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This example uses the following values"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Method"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GET"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["https://api-cdp.treasuredata.com/entities/journeys/{journeyId}"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Header"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: TD1 <YOUR_API_KEY>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Header"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Content-Type: application/json"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use a base URL that is optimal for your geographic location. For details, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["Treasure Data Sites and baseURLs"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"Sample Request","header":{"title":"Sample Request","controls":{"copy":{}}},"source":"export journeyId=\"117385\"\nexport API_KEY=\"<YOUR_API_KEY>\"\n\ncurl --location --request GET \"https://api-cdp.treasuredata.com/entities/journeys/${journeyId}\" \\\n  --header 'Content-Type: application/json' \\\n  --header 'Accept: application/json' \\\n  --header \"Authorization: TD1 ${API_KEY}\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"Sample Response","header":{"title":"Sample Response","controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"id\": \"117385\",\n    \"type\": \"journey\",\n    \"attributes\": {\n      \"audienceId\": \"57350\",\n      \"name\": \"Purchase journey\",\n      \"description\": \"\",\n      \"state\": \"draft\",\n      \"goal\": null,\n      \"createdAt\": \"2023-09-11T20:47:29.086Z\",\n      \"updatedAt\": \"2023-09-11T20:47:29.086Z\",\n      \"launchedAt\": null,\n      \"allowReentry\": false,\n      \"paused\": false,\n      \"pausedAt\": null,\n      \"journeyStages\": [\n        {\n          \"id\": \"149348\",\n          \"name\": \"Awareness\",\n          \"description\": null,\n          \"steps\": {\n            \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\": {\n              \"type\": \"Activation\",\n              \"next\": \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\",\n              \"description\": null,\n              \"name\": \"act_1\",\n              \"journeyActivationStepId\": \"153668\"\n            },\n            \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\": {\n              \"type\": \"WaitStep\",\n              \"next\": null,\n              \"waitStep\": 1,\n              \"waitStepUnit\": \"day\"\n            }\n          },\n          \"rootStep\": \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\",\n          \"entryCriteria\": {\n            \"name\": \"browse\",\n            \"segmentId\": \"912056\",\n            \"description\": \"\"\n          },\n          \"milestone\": null,\n          \"exitCriterias\": null\n        }\n      ]\n    },\n    \"relationships\": {\n      \"parentFolder\": {\n        \"data\": {\n          \"id\": \"183985\",\n          \"type\": \"folder-segment\"\n        }\n      },\n      \"jumpFrom\": {\n        \"data\": []\n      },\n      \"jumpTo\": {\n        \"data\": []\n      }\n    }\n  }\n}\n\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["About this request:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyId"]}," with the draft journey to which you want to add or update A/B tests."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_KEY"]}," with your personal API key."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["About this response object:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The name of the A/B test and its variants are contained within the journey stage."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-ab-tests-in-a-journey","__idx":4},"children":["Create A/B Tests in a Journey"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You add an A/B test to any decision point; there is no limit to the number of A/B tests within a journey. The following example sets up a test name, number of variants, percentage allocation to each variable, and a stable ID key."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"Sample Request","header":{"title":"Sample Request","controls":{"copy":{}}},"source":"export journeyId=\"117385\"\nexport API_KEY=\"<YOUR_API_KEY>\"\n\ncurl --location --request POST \"https://api-cdp.treasuredata.com/entities/journeys/${journeyId}\" \\\n  --header 'Content-Type: application/json' \\\n  --header 'Accept: application/json' \\\n  --header \"Authorization: TD1 ${API_KEY}\" \\\n  --data-raw '{\n    \"type\": \"ABTest\",\n    \"name\": \"A/B Test Name\",\n    \"customizedSplit\": true,\n    \"uniqueId\": \"cdp_customer_id\",\n    \"variants\": [\n      {\n        \"id\": \"ee9aa667-60c7-42e0-b8b1-5cee9a2edfb3\",\n        \"name\": \"Variant A\",\n        \"percentage\": 45,\n        \"next\": null\n      },\n      {\n        \"id\": \"d4179b47-8d9a-495c-bddd-5dcf25c295c6\",\n        \"name\": \"Variant B\",\n        \"percentage\": 5,\n        \"next\": null\n      },\n      {\n        \"id\": \"bbf9c797-efb0-41ae-83b0-53082d8337a8\",\n        \"name\": \"Control\",\n        \"percentage\": 50,\n        \"next\": null\n      }\n    ]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"Sample Response ","header":{"title":"Sample Response ","controls":{"copy":{}}},"source":"{\n    \"data\": {\n        \"id\": \"117385\",\n        \"type\": \"journey\",\n        \"attributes\": {\n            \"audienceId\": \"57350\",\n            \"name\": \"Purchase journey\",\n            \"description\": \"\",\n            \"state\": \"draft\",\n            \"goal\": null,\n            \"createdAt\": \"2023-09-11T20:47:29.086Z\",\n            \"updatedAt\": \"2023-09-11T20:47:29.086Z\",\n            \"launchedAt\": null,\n            \"allowReentry\": false,\n            \"paused\": false,\n            \"pausedAt\": null,\n            \"journeyStages\": [\n                {\n                    \"id\": \"149348\",\n                    \"name\": \"Awareness\",\n                    \"description\": null,\n                    \"steps\": {\n                        \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\": {\n                            \"type\": \"Activation\",\n                            \"next\": \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\",\n                            \"description\": null,\n                            \"name\": \"act_1\",\n                            \"journeyActivationStepId\": \"153668\"\n                        },\n                        \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\": {\n                            \"type\": \"WaitStep\",\n                            \"next\": \"e48c0c6f-7de2-4d94-9b22-c6c3eb51105e\",\n                            \"waitStep\": 1,\n                            \"waitStepUnit\": \"day\"\n                        },\n                        \"e48c0c6f-7de2-4d94-9b22-c6c3eb51105e\": {\n                            \"type\": \"ABTest\",\n                            \"variants\": [\n                                {\n                                    \"id\": \"ee9aa667-60c7-42e0-b8b1-5cee9a2edfb3\",\n                                    \"name\": \"Variant A\",\n                                    \"percentage\": 45,\n                                    \"next\": null\n                                },\n                                {\n                                    \"id\": \"d4179b47-8d9a-495c-bddd-5dcf25c295c6\",\n                                    \"name\": \"Variant B\",\n                                    \"percentage\": 5,\n                                    \"next\": null\n                                },\n                                {\n                                    \"id\": \"bbf9c797-efb0-41ae-83b0-53082d8337a8\",\n                                    \"name\": \"Control\",\n                                    \"percentage\": 50,\n                                    \"next\": null\n                                }\n                            ],\n                            \"name\": \"test\",\n                            \"customizedSplit\": true,\n                            \"uniqueId\": \"cdp_customer_id\"\n                        }\n                    },\n                    \"rootStep\": \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\",\n                    \"entryCriteria\": {\n                        \"name\": \"browse\",\n                        \"segmentId\": \"912056\",\n                        \"description\": \"\"\n                    },\n                    \"milestone\": null,\n                    \"exitCriterias\": null\n                }\n            ]\n        },\n        \"relationships\": {\n            \"parentFolder\": {\n                \"data\": {\n                    \"id\": \"183985\",\n                    \"type\": \"folder-segment\"\n                }\n            },\n            \"createdBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"updatedBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"activations\": {\n                \"data\": []\n            },\n            \"journeyActivationSteps\": {\n                \"data\": [\n                    {\n                        \"id\": \"153668\",\n                        \"type\": \"journeyActivationStep\"\n                    }\n                ]\n            },\n            \"jumpFrom\": {\n                \"data\": []\n            },\n            \"jumpTo\": {\n                \"data\": []\n            }\n        }\n    }\n }\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["About this request:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyId"]}," with the specified journey ID."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_KEY"]}," with your personal API key."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["About this response object:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The name of the A/B test and its variants are added to the journey stage."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"modify-an-ab-test","__idx":5},"children":["Modify an A/B Test"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can make changes to an A/B test while it is in draft mode. For instance, you can rename the test or its variants, delete variants or the A/B test, change the Unique ID field, or the allocation percentage."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"Sample Request","header":{"title":"Sample Request","controls":{"copy":{}}},"source":"export journeyId=\"117385\"\nexport API_KEY=\"<YOUR_API_KEY>\"\n\ncurl --location --request PATCH \"https://api-cdp.treasuredata.com/entities/journeys/${journeyId}\" \\\n  --header 'Content-Type: application/json' \\\n  --header 'Accept: application/json' \\\n  --header \"Authorization: TD1 ${API_KEY}\" \\\n  --data-raw '{\n    \"type\": \"ABTest\",\n    \"name\": \"Sending promotion emails\",\n    \"customizedSplit\": false,\n    \"uniqueId\": \"cdp_customer_id\",\n    \"variants\": [\n      {\n        \"id\": \"51527fb6-72c4-4e85-a4bc-f3b7094100a2\",\n        \"name\": \"Semi monthly\",\n        \"percentage\": 17,\n        \"next\": null\n      },\n      {\n        \"id\": \"d4179b47-8d9a-495c-bddd-5dcf25c295c6\",\n        \"name\": \"Semi weekly\",\n        \"percentage\": 17,\n        \"next\": null\n      },\n      {\n        \"id\": \"ee9aa667-60c7-42e0-b8b1-5cee9a2edfb3\",\n        \"name\": \"Weekly Once\",\n        \"percentage\": 17,\n        \"next\": null\n      },\n      {\n        \"id\": \"bbf9c797-efb0-41ae-83b0-53082d8337a8\",\n        \"name\": \"Control\",\n        \"percentage\": 49,\n        \"next\": null\n      }\n    ]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"Sample Response","header":{"title":"Sample Response","controls":{"copy":{}}},"source":"\n    \"data\": {\n        \"id\": \"117385\",\n        \"type\": \"journey\",\n        \"attributes\": {\n            \"audienceId\": \"57350\",\n            \"name\": \"Purchase journey\",\n            \"description\": \"\",\n            \"state\": \"draft\",\n            \"goal\": null,\n            \"createdAt\": \"2023-09-11T20:47:29.086Z\",\n            \"updatedAt\": \"2023-09-11T20:47:29.086Z\",\n            \"launchedAt\": null,\n            \"allowReentry\": false,\n            \"paused\": false,\n            \"pausedAt\": null,\n            \"journeyStages\": [\n                {\n                    \"id\": \"149348\",\n                    \"name\": \"Awareness\",\n                    \"description\": null,\n                    \"steps\": {\n                        \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\": {\n                            \"type\": \"Activation\",\n                            \"next\": \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\",\n                            \"description\": null,\n                            \"name\": \"act_1\",\n                            \"journeyActivationStepId\": \"153668\"\n                        },\n                        \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\": {\n                            \"type\": \"WaitStep\",\n                            \"next\": \"e48c0c6f-7de2-4d94-9b22-c6c3eb51105e\",\n                            \"waitStep\": 1,\n                            \"waitStepUnit\": \"day\"\n                        },\n                        \"e48c0c6f-7de2-4d94-9b22-c6c3eb51105e\": {\n                            \"type\": \"ABTest\",\n                            \"variants\": [\n                                {\n                                    \"id\": \"51527fb6-72c4-4e85-a4bc-f3b7094100a2\",\n                                    \"name\": \"Semi monthly\",\n                                    \"percentage\": 17,\n                                    \"next\": null\n                                },\n                                {\n                                    \"id\": \"d4179b47-8d9a-495c-bddd-5dcf25c295c6\",\n                                    \"name\": \"Semi weekly\",\n                                    \"percentage\": 17,\n                                    \"next\": null\n                                },\n                                {\n                                    \"id\": \"ee9aa667-60c7-42e0-b8b1-5cee9a2edfb3\",\n                                    \"name\": \"Weekly Once\",\n                                    \"percentage\": 17,\n                                    \"next\": null\n                                },\n                                {\n                                    \"id\": \"bbf9c797-efb0-41ae-83b0-53082d8337a8\",\n                                    \"name\": \"Control\",\n                                    \"percentage\": 49,\n                                    \"next\": null\n                                }\n                            ],\n                            \"name\": \"Sending promotion emails\",\n                            \"customizedSplit\": false,\n                            \"uniqueId\": \"cdp_customer_id\"\n                        }\n                    },\n                    \"rootStep\": \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\",\n                    \"entryCriteria\": {\n                        \"name\": \"browse\",\n                        \"segmentId\": \"912056\",\n                        \"description\": \"\"\n                    },\n                    \"milestone\": null,\n                    \"exitCriterias\": null\n                }\n            ]\n        },\n        \"relationships\": {\n            \"parentFolder\": {\n                \"data\": {\n                    \"id\": \"183985\",\n                    \"type\": \"folder-segment\"\n                }\n            },\n            \"createdBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"updatedBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"activations\": {\n                \"data\": []\n            },\n            \"journeyActivationSteps\": {\n                \"data\": [\n                    {\n                        \"id\": \"153668\",\n                        \"type\": \"journeyActivationStep\"\n                    }\n                ]\n            },\n            \"jumpFrom\": {\n                \"data\": []\n            },\n            \"jumpTo\": {\n                \"data\": []\n            }\n        }\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["About this request:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyId"]}," with journey you want to add or update A/B tests."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_KEY"]}," with your personal API key."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["About this response object:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The name of the A/B test and its variants have been modified."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The number of variants is increased in the response from 2 to 3."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The customized splits is changed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The percentage allocated to each variant has also been modified."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"delete-an-ab-test","__idx":6},"children":["Delete an A/B Test"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can delete an A/B test while it is in draft mode."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The section contains:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#verify-the-ab-test-in-the-journey-stage"},"children":["Verify the A/B Test in the Journey Stage"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#delete-an-ab-test-within-a-journey-stage"},"children":["Delete an A/B test Within a Journey Stage"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#confirming-journey-status"},"children":["Confirming Journey Status"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"verify-the-ab-test-in-the-journey-stage","__idx":7},"children":["Verify the A/B Test in the Journey Stage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To confirm which A/B test to delete, you first need to confirm an A/B Test applied to a stage. In the example that follows, you can view the journey stage and A/B tests for journey ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["117385"]},".",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Sample Request"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"Sample Request Verify A/B Test","header":{"title":"Sample Request Verify A/B Test","controls":{"copy":{}}},"source":"export journeyId=\"117385\"\nexport API_KEY=\"<YOUR_API_KEY>\"\n\ncurl --location --request GET \"https://api-cdp.treasuredata.com/entities/journeys/${journeyId}\" \\\n  --header 'Content-Type: application/json' \\\n  --header 'Accept: application/json' \\\n  --header \"Authorization: TD1 ${API_KEY}\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"Sample Response","header":{"title":"Sample Response","controls":{"copy":{}}},"source":"{\n    \"data\": {\n        \"id\": \"117385\",\n        \"type\": \"journey\",\n        \"attributes\": {\n            \"audienceId\": \"57350\",\n            \"name\": \"Purchase journey\",\n            \"description\": \"\",\n            \"state\": \"draft\",\n            \"goal\": null,\n            \"createdAt\": \"2023-09-11T20:47:29.086Z\",\n            \"updatedAt\": \"2023-09-11T20:47:29.086Z\",\n            \"launchedAt\": null,\n            \"allowReentry\": false,\n            \"paused\": false,\n            \"pausedAt\": null,\n            \"journeyStages\": [\n                {\n                    \"id\": \"149348\",\n                    \"name\": \"Awareness\",\n                    \"description\": null,\n                    \"steps\": {\n                        \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\": {\n                            \"type\": \"Activation\",\n                            \"next\": \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\",\n                            \"description\": null,\n                            \"name\": \"act_1\",\n                            \"journeyActivationStepId\": \"153668\"\n                        },\n                        \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\": {\n                            \"type\": \"WaitStep\",\n                            \"next\": \"e48c0c6f-7de2-4d94-9b22-c6c3eb51105e\",\n                            \"waitStep\": 1,\n                            \"waitStepUnit\": \"day\"\n                        },\n                        \"e48c0c6f-7de2-4d94-9b22-c6c3eb51105e\": {\n                            \"type\": \"ABTest\",\n                            \"variants\": [\n                                {\n                                    \"id\": \"51527fb6-72c4-4e85-a4bc-f3b7094100a2\",\n                                    \"name\": \"Semi monthly\",\n                                    \"percentage\": 17,\n                                    \"next\": null\n                                },\n                                {\n                                    \"id\": \"d4179b47-8d9a-495c-bddd-5dcf25c295c6\",\n                                    \"name\": \"Semi weekly\",\n                                    \"percentage\": 17,\n                                    \"next\": null\n                                },\n                                {\n                                    \"id\": \"ee9aa667-60c7-42e0-b8b1-5cee9a2edfb3\",\n                                    \"name\": \"Weekly Once\",\n                                    \"percentage\": 17,\n                                    \"next\": null\n                                },\n                                {\n                                    \"id\": \"bbf9c797-efb0-41ae-83b0-53082d8337a8\",\n                                    \"name\": \"Control\",\n                                    \"percentage\": 49,\n                                    \"next\": null\n                                }\n                            ],\n                            \"name\": \"Sending promotion emails\",\n                            \"customizedSplit\": false,\n                            \"uniqueId\": \"cdp_customer_id\"\n                        }\n                    },\n                    \"rootStep\": \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\",\n                    \"entryCriteria\": {\n                        \"name\": \"browse\",\n                        \"segmentId\": \"912056\",\n                        \"description\": \"\"\n                    },\n                    \"milestone\": null,\n                    \"exitCriterias\": null\n                }\n            ]\n        },\n        \"relationships\": {\n            \"parentFolder\": {\n                \"data\": {\n                    \"id\": \"183985\",\n                    \"type\": \"folder-segment\"\n                }\n            },\n            \"createdBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"updatedBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"activations\": {\n                \"data\": []\n            },\n            \"journeyActivationSteps\": {\n                \"data\": [\n                    {\n                        \"id\": \"153668\",\n                        \"type\": \"journeyActivationStep\"\n                    }\n                ]\n            },\n            \"jumpFrom\": {\n                \"data\": []\n            },\n            \"jumpTo\": {\n                \"data\": []\n            }\n        }\n    }   \n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["About this request:"," ","An A/B test can be deleted from a journey stage by omitting the test in the same PATCH request. This request confirms the specified journey has an A/B Test in Stage 1."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyId"]}," with journey you want to add or update A/B tests."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_KEY"]}," with your personal API key."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"delete-an-ab-test-within-a-journey-stage","__idx":8},"children":["Delete an A/B Test Within a Journey Stage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To delete the A/B test, the information about the A/B test is omitted from the PATCH. In the example that follows, the A/B test and its associated variants are absent from the payload for journey ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["117385"]},".",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"Sample Request - Omit the A/B Test","header":{"title":"Sample Request - Omit the A/B Test","controls":{"copy":{}}},"source":"export journeyId=\"117385\"\nexport API_KEY=\"<YOUR_API_KEY>\"\n\ncurl --location --request PATCH \"https://api-cdp.treasuredata.com/entities/journeys/${journeyId}\" \\\n  --header 'Content-Type: application/json' \\\n  --header 'Accept: application/json' \\\n  --header \"Authorization: TD1 ${API_KEY}\" \\\n  --data-raw '{\n    \"id\": \"117385\",\n        \"type\": \"journey\",\n        \"attributes\": {\n            \"audienceId\": \"57350\",\n            \"name\": \"Purchase journey\",\n            \"description\": \"\",\n            \"state\": \"draft\",\n            \"goal\": null,\n            \"createdAt\": \"2023-09-11T20:47:29.086Z\",\n            \"updatedAt\": \"2023-09-11T20:47:29.086Z\",\n            \"launchedAt\": null,\n            \"allowReentry\": false,\n            \"paused\": false,\n            \"pausedAt\": null,\n            \"journeyStages\": [\n                {\n                    \"id\": \"149348\",\n                    \"name\": \"Awareness\",\n                    \"description\": null,\n                    \"steps\": {\n                        \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\": {\n                            \"type\": \"Activation\",\n                            \"next\": \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\",\n                            \"description\": null,\n                            \"name\": \"act_1\",\n                            \"journeyActivationStepId\": \"153668\"\n                        },\n                        \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\": {\n                            \"type\": \"WaitStep\",\n                            \"next\": null,\n                            \"waitStep\": 1,\n                            \"waitStepUnit\": \"day\"\n                        }\n                    },\n                    \"rootStep\": \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\",\n                    \"entryCriteria\": {\n                        \"name\": \"browse\",\n                        \"segmentId\": \"912056\",\n                        \"description\": \"\"\n                    },\n                    \"milestone\": null,\n                    \"exitCriterias\": null\n                }\n            ]\n        },\n        \"relationships\": {\n            \"parentFolder\": {\n                \"data\": {\n                    \"id\": \"183985\",\n                    \"type\": \"folder-segment\"\n                }\n            },\n            \"createdBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"updatedBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"activations\": {\n                \"data\": []\n            },\n            \"journeyActivationSteps\": {\n                \"data\": [\n                    {\n                        \"id\": \"153668\",\n                        \"type\": \"journeyActivationStep\"\n                    }\n                ]\n            },\n            \"jumpFrom\": {\n                \"data\": []\n            },\n            \"jumpTo\": {\n                \"data\": []\n            }\n        }\n}\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["About this request:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The name of the A/B test and its variants have been removed from the PATCH request."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The \"next\" step is marked as \"null\" in the object preceding the A/B test."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyId"]}," with journey from which you want to remove an A/B test."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_KEY"]}," with your personal API key."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"Sample Response - Confirms absence of A/B Test","header":{"title":"Sample Response - Confirms absence of A/B Test","controls":{"copy":{}}},"source":"{\n  \"data\": {\n        \"id\": \"117385\",\n        \"type\": \"journey\",\n        \"attributes\": {\n            \"audienceId\": \"57350\",\n            \"name\": \"Purchase journey\",\n            \"description\": \"\",\n            \"state\": \"draft\",\n            \"goal\": null,\n            \"createdAt\": \"2023-09-11T20:47:29.086Z\",\n            \"updatedAt\": \"2023-09-11T20:47:29.086Z\",\n            \"launchedAt\": null,\n            \"allowReentry\": false,\n            \"paused\": false,\n            \"pausedAt\": null,\n            \"journeyStages\": [\n                {\n                    \"id\": \"149348\",\n                    \"name\": \"Awareness\",\n                    \"description\": null,\n                    \"steps\": {\n                        \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\": {\n                            \"type\": \"Activation\",\n                            \"next\": \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\",\n                            \"description\": null,\n                            \"name\": \"act_1\",\n                            \"journeyActivationStepId\": \"153668\"\n                        },\n                        \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\": {\n                            \"type\": \"WaitStep\",\n                            \"next\": null,\n                            \"waitStep\": 1,\n                            \"waitStepUnit\": \"day\"\n                        }\n                    },\n                    \"rootStep\": \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\",\n                    \"entryCriteria\": {\n                        \"name\": \"browse\",\n                        \"segmentId\": \"912056\",\n                        \"description\": \"\"\n                    },\n                    \"milestone\": null,\n                    \"exitCriterias\": null\n                }\n            ]\n        },\n        \"relationships\": {\n            \"parentFolder\": {\n                \"data\": {\n                    \"id\": \"183985\",\n                    \"type\": \"folder-segment\"\n                }\n            },\n            \"createdBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"updatedBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"activations\": {\n                \"data\": []\n            },\n            \"journeyActivationSteps\": {\n                \"data\": [\n                    {\n                        \"id\": \"153668\",\n                        \"type\": \"journeyActivationStep\"\n                    }\n                ]\n            },\n            \"jumpFrom\": {\n                \"data\": []\n            },\n            \"jumpTo\": {\n                \"data\": []\n            }\n        }\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["About this response:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The response confirms the A/B test and its variants have been removed from the journey stage."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"confirming-journey-status","__idx":9},"children":["Confirming Journey Status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If additional confirmation apart from the response is required, you can do a GET to the endpoint ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["entities/journeys/{journey_id}"]},". A similar response as the PATCH request's response is displayed when a GET to the same journey in performed. The journey attributes do not display any A/B test information, as it was successfully deleted during the PATCH request."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"Sample Response - Confirms Journey Status","header":{"title":"Sample Response - Confirms Journey Status","controls":{"copy":{}}},"source":"{\n  \"data\": {\n        \"id\": \"117385\",\n        \"type\": \"journey\",\n        \"attributes\": {\n            \"audienceId\": \"57350\",\n            \"name\": \"Purchase journey\",\n            \"description\": \"\",\n            \"state\": \"draft\",\n            \"goal\": null,\n            \"createdAt\": \"2023-09-11T20:47:29.086Z\",\n            \"updatedAt\": \"2023-09-11T20:47:29.086Z\",\n            \"launchedAt\": null,\n            \"allowReentry\": false,\n            \"paused\": false,\n            \"pausedAt\": null,\n            \"journeyStages\": [\n                {\n                    \"id\": \"149348\",\n                    \"name\": \"Awareness\",\n                    \"description\": null,\n                    \"steps\": {\n                        \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\": {\n                            \"type\": \"Activation\",\n                            \"next\": \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\",\n                            \"description\": null,\n                            \"name\": \"act_1\",\n                            \"journeyActivationStepId\": \"153668\"\n                        },\n                        \"2903c0a0-e43c-4ed6-8e0c-1b682be1cc03\": {\n                            \"type\": \"WaitStep\",\n                            \"next\": null,\n                            \"waitStep\": 1,\n                            \"waitStepUnit\": \"day\"\n                        }\n                    },\n                    \"rootStep\": \"4e7dcb3e-4f3a-4a6c-be3f-a37b09acbac7\",\n                    \"entryCriteria\": {\n                        \"name\": \"browse\",\n                        \"segmentId\": \"912056\",\n                        \"description\": \"\"\n                    },\n                    \"milestone\": null,\n                    \"exitCriterias\": null\n                }\n            ]\n        },\n        \"relationships\": {\n            \"parentFolder\": {\n                \"data\": {\n                    \"id\": \"183985\",\n                    \"type\": \"folder-segment\"\n                }\n            },\n            \"createdBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"updatedBy\": {\n                \"data\": {\n                    \"id\": \"1020\",\n                    \"type\": \"user\"\n                }\n            },\n            \"activations\": {\n                \"data\": []\n            },\n            \"journeyActivationSteps\": {\n                \"data\": [\n                    {\n                        \"id\": \"153668\",\n                        \"type\": \"journeyActivationStep\"\n                    }\n                ]\n            },\n            \"jumpFrom\": {\n                \"data\": []\n            },\n            \"jumpTo\": {\n                \"data\": []\n            }\n        }\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ab-testing-statistics","__idx":10},"children":["A/B Testing Statistics"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can choose to show the number of profiles in a particular A/B test variant within the same parent segment using the following rule."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"type\": \"And\",\n  \"conditions\": [\n    {\n      \"type\": \"Value\",\n      \"exclude\": true,\n      \"leftValue\": {\n        \"journeyId\": 1,\n        \"journeyStageId\": 2,\n        \"location\": \"ab_test_<UUID with underscore>_variant_<Variant UUID>\",\n        \"tense\": \"intime\"\n      },\n      \"operator\": {\n        \"type\": \"IsNull\",\n        \"not\": true\n      }\n    }\n  ]\n}\n\n","lang":"json"},"children":[]}]},"headings":[{"value":"Configuring A/B Testing","id":"configuring-ab-testing","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Limitations","id":"limitations","depth":2},{"value":"Verify the Status of a Journey","id":"verify-the-status-of-a-journey","depth":2},{"value":"Create A/B Tests in a Journey","id":"create-ab-tests-in-a-journey","depth":2},{"value":"Modify an A/B Test","id":"modify-an-ab-test","depth":2},{"value":"Delete an A/B Test","id":"delete-an-ab-test","depth":2},{"value":"Verify the A/B Test in the Journey Stage","id":"verify-the-ab-test-in-the-journey-stage","depth":3},{"value":"Delete an A/B Test Within a Journey Stage","id":"delete-an-ab-test-within-a-journey-stage","depth":3},{"value":"Confirming Journey Status","id":"confirming-journey-status","depth":3},{"value":"A/B Testing Statistics","id":"ab-testing-statistics","depth":2}],"frontmatter":{"seo":{"title":"Configuring A/B Testing","description":"Learn how to configure A/B testing in customer journeys using the Audience API to compare up to eight variants and optimize marketing campaigns."}},"lastModified":"2026-02-17T14:14:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/apis/audience-api/ab-testing","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}