# Optimize communication through A/B testing
---

A/B testing in an experiment that enables you to compare different variations of a communication to identify which one performs better Compare the results to see how your audiences react to your content what channel they prefer or the best time to send them communication Use these results to optimize your communication campaigns

The following are examples of how to use A/B testing

- Compare how different channels perform with your audience
- Pretest different versions of a campaign and identify the one that performs the best

This tutorial explains how to set up an A/B test for different channels within a flow and identify the channel that performs the best

You can use any supported channel This tutorial uses SMS Apple Messages for Business and Email channels
  
## Products and channels [#products-channels]

- [Moments](https://www.infobip.com/docs/moments)
- [Apple Messages for Business](https://www.infobip.com/docs/apple-messages-for-business)
- [Email](https://www.infobip.com/docs/email)
- [LINE](https://www.infobip.com/docs/line)
- [Messenger](https://www.infobip.com/docs/facebook-messenger)
- [MMS](https://www.infobip.com/docs/mms)
- [Mobile push and In-app messages](https://www.infobip.com/docs/mobile-push)
- [RCS](https://www.infobip.com/docs/rcs)
- [SMS](https://www.infobip.com/docs/sms)
- [Viber](https://www.infobip.com/docs/viber)
- [Voice](https://www.infobip.com/docs/voice-and-video)
- [WhatsApp](https://www.infobip.com/docs/whatsapp)

## Prerequisites [#prerequisites]

- Infobip account with Moments enabled If you do not have an account [sign up](https://www.infobip.com/signup) for an account
- At least two supported channels

## Process overview [#process-overview]

1 In a flow campaign split your audience into 2 or more groups
2 Send each group the same message but through different channels
3 See the metrics to identify which channel performed the best
4 Use these metrics to optimize the existing campaign or plan a future campaign

## Implementation steps [#implementation-steps]

1 In a flow in Moments select an [entry point](https://www.infobip.com/docs/moments/flow-elements/flow-entry-exit) for the communication This example uses the [**People real-time event**](https://www.infobip.com/docs/moments/flow-elements/flow-entry-exit#people-real-time-event-triggers) entry point with the *Item added to wishlist* event as the trigger
2 Add the [**Split Audience**](https://www.infobip.com/docs/moments/flow-elements/functions#split-audience-functions) element Select the number of subsets into which you want to divide the audience and the proportion for each subset

   Separate branches are created for each audience End users are randomly assigned to each branch

3 Add different channels with a similar message in each channel This example uses SMS Apple Messages for Business and Email channels The message offers a 30% discount to the end users
4 **For all channels except Email** Add the [**Evaluate inbound message**](https://www.infobip.com/docs/moments/flow-elements/channels#evaluate-inbound-message) element In the channel elements add keywords that help you know the end user's reaction

   **For Email** Add the [**Wait for an event**](https://www.infobip.com/docs/moments/flow-elements/functions#wait-for-an-event-functions) element and select **Email link clicked**
5 **For all channels except Email** If the end users responded using the keyword send another message with instructions about the discount

   **For Email** If the end users clicked the link send another message with instructions about the discount
6 To each channel add the **Wait for an event** element and select an [event](https://docs.ib-host.com/docs/people/events) such as *Item purchased* This event lets you know whether the end user reacted to your message and completed the purchase Configure how long you want to wait before sending another message based on their actions Example 2 days
7 (Optional) Send a thank you message to those who made a purchase You could also decide to continue the flow by sending another reminder to those who have not reacted to your communication
8 After you validate and launch the flow you can check the [flow performance](https://www.infobip.com/docs/moments/manage-flow#performance)

## Analytics [#analytics]

Select your campaign to see how the channels performed Hover over a channel element to view the statistics for that channel

The statistics are channel specific The **Number of engaged persons** and **Performance ratio** information is available for all channels

Example For the SMS channel you can view the following data

- Number of end users to whom the message was sent
- Total number of engagements which includes multiple entries into the flow by some end users
- Total number of sent messages

## Next steps [#next-steps]

Use the results of the A/B test to optimize your campaign or to plan future communication with end users

### Use performance data for future campaigns

Use the performance data to build future campaigns Example If SMS was the most successful channel use the SMS channel to send messages to end users in your next campaign

## Additional options [#additional-options]

The following are other ways in which you can use A/B testing

### Pretest and send the best message [#pretest-select-best-message]

Another A/B testing option in Flow is to test messages for a segment of your audience and send the best message to the remaining audience

The steps are similar to the ones in the Implementation steps section In this case split the audience into 4 Use 3 audience branches for pretesting Add a tag to the fourth segment Example *winning_segment*

After you identify the best performing message among the 3 audience segments you can send that message to the fourth segment through a new campaign Do the following

1 In Moments either [create](https://www.infobip.com/docs/moments/manage-flow#create) another flow that is similar to the earlier one or [duplicate the flow](https://www.infobip.com/docs/moments/manage-flow#duplicate)
2 Select the [**Predefined Audience**](https://www.infobip.com/docs/moments/flow-elements/flow-entry-exit#predefined-audience) entry point
3 You need to select the fourth segment which you created in the earlier flow as the audience You can identify this segment from the tag that you added to it So add the *winning_segment* tag to the entry point
4 Add a [**Send SMS message**](https://www.infobip.com/docs/moments/flow-elements/channels#sms-channels) element The message offers a 30% discount to the end users
5 Add the [**Evaluate Inbound SMS**](https://www.infobip.com/docs/moments/flow-elements/channels#evaluate-inbound-message) element In the element add keywords that help you know the end user's reaction
6 If the end users responded using the keyword send another message with instructions about the discount Add a **Send SMS message** element
7 Add the **Wait for an event** element and select an event such as *Item purchased* This event lets you know whether the end user reacted to your message and completed the purchase Configure how long you want to wait before sending another message based on their actions Example 2 days

The flow should be similar to the following image

### Compare multiple flow versions

To test variations in flow versions change any parameter or attribute of a message for the different test versions Then compare the testing results for different versions