How to setup server-side A/B testing

Created by LiRou C, Modified on Thu, 13 Feb at 8:38 PM by LiRou C

Server-side A/B testing is a method of conducting experiments to compare two or more versions of a web page, feature, or user experience by implementing the variations on the server rather than in the user's browser. 


This approach allows for more complex and robust testing scenarios compared to client-side A/B testing.


In server-side A/B testing:

  1. The server determines which version of the content or feature to show to each user.
  2. The entire page or feature is generated on the server before being sent to the user's browser.
  3. The user receives a complete version of the page or feature, unaware that they are part of an experiment.


While server-side A/B testing offers many advantages, it can be more complex to set up and maintain compared to client-side testing. It may also require more server resources and can be less flexible for quick iterations. The choice between server-side and client-side A/B testing depends on your specific needs, technical capabilities, and the nature of the experiments you want to conduct.



How to setup server-side testing:


1. Create a new experiment and choose 'Server-side Testing'.




2. Give your campaign a name and assign an experiment key as a unique identifier for your test profile. 



3. Next, choose your preferred SDK to view sample code. Copy and paste the following code to activate the experiment in your application.




4. Update the SDK code with your variables. Once you have these variables set up, you'll be able to determine which version (control or variant) a client sees and enable the appropriate design. 


Public Key: This is your unique Mida project key, which you can find in your project settings where you obtained the pixel snippet.


Experiment Key: This is a custom value you create when setting up a server-side test in Mida. It's a unique identifier for your test profile. For example, you might use "new-design-test" as your experiment key.



Distinct ID: This is a unique identifier for each visitor. Since server-side testing doesn't have access to browser footprints, you'll need to use an internal system user ID or email address to distinguish between users.



5. You can then use the setEvent method to track goal completions. Copy the script and add it to an event which confirms the goal has been reached.




6. Add any further configurations to your test and finally 'Publish' it! Congratulations on being one step closer to delivering optimal user experience to your users!




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article