I am going to write a quick blog post about starting A/B Test via workflow, In Sitecore CMS version 8.0 and up, Sitecore Content testing has changed quite a bit with array of new functionalities. Up until sitecore CMS version 7.2 you could create and start the test in page editor using a “START” button (See Image Below). But in version sitecore 8.0 you would not be able to do so from the Experience Editor. This post will go through the process of configuring the A/B test via workflow and hence allowing content editors to execute the test from experience editor.
Create Workflow Command : Start Multivariate Test
Create a Workflow Command named Start Multivariate Test using a command template (/sitecore/templates/System/Workflow/Command). This command will allow the user to create and start the tests on the selected item
On the newly created command , please fill in the “Appearance Evaluator Type” field with this value “Sitecore.ContentTesting.Workflows.TestCandidatesCommandStateEvaluator, Sitecore.ContentTesting”(See Below) . This value will allow sitecore to show /Hide this workflow steps based on multiple conditions such as Is Content Testing Enabled, Is Automatic Content Testing Enabled , Is the test already running, Is the test valid etc.
Create Workflow Action: Launch Create Test Dialog
We will now create a action which will be executed as soon as the user executes the Start Multivariate Test command. Sitecore has a inbuilt wizard built in SPEAK for creating A/B test. Let us see how to configure that
create a action named “Launch Create Test Dialog” based of the a special template called “/sitecore/templates/System/Content Testing/Workflow/Launch Create Test Dialog Action”
Type String : Sitecore.ContentTesting.Workflows.LaunchCreateTestDialogAction, Sitecore.ContentTesting
Also check the “Create Suggested Tests If No Wizard” which will create a suggested test if there are no test to be configured on the page by sitecore.
This is all you need to start the multivariate test on a custom workflow. If you need to clean up existing test or remove unwanted tests form you page you can do it as follows
Create Workflow Action: Remove Test
In order to clean up or remove Tests, create a action named “Remove Test” based of the a special template called “ /sitecore/templates/System/Content Testing/Workflow/Remove Tests Action”
Type String: Sitecore.ContentTesting.Workflows.RemoveTestsAction, Sitecore.ContentTesting
Check the Delete Test Definition checkbox
Executing this step will cleanup all the test definition which are stored here /sitecore/system/Marketing Control Panel/Test Lab
That’s all for now, please comment if you have further questions on the same.