Skip to main content
A couple of steps will help you prepare your A/B testing environment.

Set up click analytics

Because Algolia uses click and conversion rates to do comparative A/B testing, you must send click and conversion events first. The Revenue Analytics feature includes sending purchase and addToCart conversion events.
This feature isn’t available on every plan. Refer to your pricing plan to see if it’s included.

Add unique user identifiers to your searches

Make sure every search is associated with a unique user identifier. This serves two purposes:
  • Guarantees consistent variant assignment. Algolia assigns each new user to a variant based on their user ID. This assignment is stable as long as the same user ID is provided for subsequent search sessions.
  • Ensures distribution integrity. Users remain in their assigned variant, which helps ensure reliable test results.
Algolia uses unique user tokens to ensure that the same user is always directed to the same variant. By default, the user token is the user’s IP address. However, it’s better to explicitly create a unique user identifier that you can keep track of in your own application. The user identifier can be sent to Algolia with the userToken parameter, or with the X-Algolia-UserToken request header.

A/B testing

After completing these steps, follow the dashboard’s process to start, stop, and view your tests. If you want to A/B test different settings for the same index in the dashboard, select the same index for both variants.
⌘I