Creating Custom Strategies in Sitecore DMS: Multivariate Tests

Apr 11, 2013
Pablo Bustamante

Sitecore’s Digital Marketing System (DMS) lets you optimize your site for your customers. To determine the best web experience for your customers, Sitecore DMS has A/B Multivariate (MV) Testing  feature with two main out-of-the-box testing strategies:

1. Random: test variables are changed every time

2. Sticky: test variables are the same for each visitor

These two strategies are excellent starting points for any basic testing of your site features, but as you grow in the system you might want to create more complex experiments to fine tune the web experience you provide.  In order to create your own strategies, follow these steps:

1. Create your own strategy code by extending MultiVariateTestStrategyBase and IMultiVariateTestStrategy. For example:

using System;

using Sitecore.Analytics.Testing;

namespace Application.Namespace

{

                public class YOURMultiVariateTestStrategy : MultiVariateTestStrategyBase, IMultiVariateTestStrategy

                {

                                public TestCombination GetTestCombination(TestSet testset)

                                {

                                                Random random = new Random();

                                                byte[] combination = new byte[ testset.Variables.Count];

                                                for (int i = 0; I < combination.Lenght; i++)

                                                {

                                                                // here add your testing logic

                                                                combination[i] = (byte) random.Next (testset.Variables[i].Values.Count);

                                                }

                                                return new TestCombination(combination, testset);

                                }

                }

}

2. Compile your solution and deploy all the necessary libraries to your environment.

3. Login into Sitecore and create a new “Multivariate Test Strategy” Item in /sitecore/system/Settings/Analytics/Multivariate Test Strategies/

4. In the newly created multivariate test strategy, fill the “type” field with “<namespace>.<class name>, <library filename>”

5. Save all changes. Now you should be able to use your new strategy in any test.

Sitecore’s DMS MV Testing allows you to provide top-of-the-line experiences for your website visitors through various testing methods.