How to integrate with an existing A/B testing system

Ajay Bhoj

Dec 03, 2018



In an earlier post on An Overview of Server-side Integrations with, we discussed high-level concepts related to server-side integrations. In this post, we'll discuss integrating with an existing A/B testing system on the server side. If you already use an in-house A/B testing system, can be purely additive, and complement it very well. Most importantly, can boost your key metrics without requiring any major changes to your A/B testing infrastructure. For a quick introduction to the key concepts in that are necessary to follow this post, please see vs A/B Testing: A paradigm shift

UserId based session management: An example

A/B testing frameworks generally assign a user to a "variant-group" based on a function that maps the user identifier or UserId to the variant-group. While integrating with, it is possible to compose sessions solely based on UserIds, requiring no changes to your A/B testing framework.

Let us dive deeper with an example. In the campaign optimization example shown below (also see our post on How to integrate with on the server side using AmpTokens), the Context event is extracted from the browser user-agent, the Decision event is used to decide which campaign slogan to show, and the Outcome event is triggered when a visitor clicks the donate button. The objective of the optimization is to improve chances of a donation by picking the best campaign slogan.


To implement the above, we can use the UserId provided by the A/B testing system or any identifier that serves as a proxy to UserId. An example architecture is shown below:


Some observations:

Implementation pseudocode is shown below:


The above is very similar to session management with AmpTokens, described in How to integrate with on the server side using AmpTokens


In this post, we explored an example server-side integration with that used UserId based session management, where UserIds could be supplied by an A/B testing framework or any user identification service. To summarize, can be a great addition to your A/B testing setup as it:

For more information, contact us here or email us at Schedule a demo here