Skip to main content

Perform A/B Testing in LoyJoy

What This Solution Will Do for You

This article is right for you if you want to run an A/B test with two (or more) different chats within the same experience.

What You Need for This Solution to Work

This article offers two different options. Either control over the URL parameters of the link your users open your website with. Or simply a LoyJoy experience that you can modify.

There Are Two Options for A/B Testing

  • Switching experiences based on freely defined URL parameters
  • Switching inside one experience base on a random 50/50 split in LoyJoy

Switching Experiences With URL Parameters

Let's say your website has the URL https://www.example.org. Just use two or more parameters that you can access in LoyJoy like this:

https://www.example.org?loyjoy-myparam=value1

and

https://www.example.org?loyjoy-myparam=value2

It is required that the param name starts with loyjoy- so that LoyJoy can identify it. After the loyjoy- you can add a custom name for your parameter. If you need more than one parameter, connect the parameters with an &, for example https://www.example.org?loyjoy-myparam=value1&my-tracking=trackig-code.

Inside LoyJoy, we can access this parameter and, for example, make an automatic jump based on it:

LoyJoy A/B testing with URL params

Here, we trigger an automatic jump, if the given parameter has the value true. This jump can lead to a specific position in the process or to another process altogether.

Switching Based on Random 50/50 Split in LoyJoy

For this approach we need to set a random variable at the beginning of the experience that sets up the 50/50 split: Variable Random

For the next step, you will use a Gateway at the spot where you want the experience to differ and add two branches. Gateway

Condition both gateways with the variable random that was created in the first step.

Condition

Condition

For the last step, just pull the modules for each strand individually into the experience. Both A and B users will end up in the same strand again after passing through their individual strand. Below, the users will reconcile in the Quiz module.

Quiz

For an overview of how many users enter each strand, go to your analytics and click on the right experience. In the drill-down you are able to see the number of users for each strand.

Analytics

Here we can see that out of 10 users that started the experience, 4 entered as variable 0 into the left strand and 6 entered as variable 1 into the right strand.