Stop a/b testing - here’s something better

Optimizing your website is a good idea - if you are doing it right. The problem with using a/b testing for this is that it assumes there is this one perfect version of your site that works for everyone. If that does not actually exist, what you end up doing instead is optimizing for a really average site that maybe works ok for most visitors, while at the same time potentially getting rid of all the versions that work exceptionally well on a subset of your users. What you should do instead is find those versions and figure out which users to show them to. AddAI does this for you, while worst case doing just as well as a/b testing.


You add our script to your site, annotate a few different options and define a reward for us if we make something good happen (like a sale) - we will then, every time someone visits your site, pick one of those options and hide the others. Internally we use AI, or to be more exact, reinforcement learning, to make it work automatically.

Getting started

First, you have to add the following lines

<link rel="stylesheet" href="">
<script src=""></script>

between the <head> and </head> of your website (you should do that on all pages). Do not change any of our code and always use our hosted version or things may break.

Second, you have to add different options to your site. You do this by adding HTML code as you would usually for all variants on the same site - only one will be visible later. The elements you want to have AddAI decide on have to be tagged by adding the data-addai="nameOfDecision:nameOfOption" adding this will make those elements disappear using CSS. Remember to actually replace nameOfDecision and nameOfOption with actual names in your code - setting the same nameOfDecision for elements adds them together to a group to choose from - nameOfOption names the individual options - you can reuse a name if you want two elements in different places appear at the same time.

You also have to select one default option and add data-addai-active to it, which will make this element visible again. AddAI will move this annotation around when selecting an option, thereby hiding the default version and showing the selected one.

A minimal example could look like this:

<span data-addai="sample-text:a" data-addai-active>A</span>
<span data-addai="sample-text:b">B</span>

As a third and last step you have to add a snippet telling us when something worked and how much you want to pay us every time it happens. For this you have to call the JavaScript function addaiSuccess(rewardInUSD, id) somewhere. You should replace rewardInUSD with an actual value. This value should be somewhat representative of how much the event is worth to you - so maybe like 5%7%10% of the profits you make for each time it happens - but feel free to play around with that. The id should also be replaced with a custom id that represents the event. It can only be triggered once per visitor (if it happens again - e.g. if the user refreshes the site, it will not count again). An example could look like this:

<button onclick="addaiSuccess(0.5, 'payEvent');">Pay</button>


Here is a full but minimal example of everything you need.

<!DOCTYPE html>

    <meta charset="UTF-8">
    <link rel="stylesheet" href="">
    <script src=""></script>

    <span data-addai="sample-text:a" data-addai-active>A</span>
    <span data-addai="sample-text:b">B</span>
    <button onclick="addaiSuccess(0.5, 'payEvent');">Pay</button>



Do I need to sign up/get an account?

No - we can detect which sites AddAI is running on and will reach out when the time comes to pay.

Do I have to pay?

Yes and no. Yes, you have to set a reward and it should also be not 0 - otherwise AddAI will not work. What we are actually doing internally is automatically selecting the options where we expect to make the most money from those rewards - meaning we are linking our success to your success.

No, you do not have to pay if you do not feel like it is worth it. We will reach out with the first bill once we feel like we have generated enough value for you (and roughly once a month after), and then it is up to you, to either pay and continue using AddAI or not pay and it will stop working. Not paying is a totally valid option - there will be no hard feelings and we also will not come after you - paying is completely optional in that sense (but it will most likely be in your best interest to pay and continue using AddAI).

How much should I pay? How high should the reward be?

You have to find a balance - we know it is in your interest to pay as little as possible. But at the same time it is also in your interest for us to do as well as possible on your site. So here is how this works: we have algorithms with different complexity levels that also have different compute costs. The really good ones will just kick in if it is worth it for us, and if it is really worth it we may even custom tune things further for your site. We can not tell you more yet, as we are still trying to figure out the best way forward here ourselves.

Will my site change all the time if a user comes back or reloads?

No. We make the user’s browser save all decision results instead of doing them again - so when he comes back, things will look exactly the same as before.

Will this break my site in case AddAI breaks?

No. If our decision servers are down the decisions will happen by random choice as a fallback. Also, if our JavaScript code blows up, things will be still ok and just show the default options you set initially.

Will this break my site in case users have JavaScript disabled?

No. In this case our CSS will still work and just show the default option. The only downside is that users will not get to see a more optimal version.

Can I have multiple decisions with lots of options on the same site?

Yes - you should - we will optimize over all of them.

Can I make decisions and rewards across different sites?

Yes. If you reuse the same names, decisions will even be consistent across different sites (as long as they are on the same domain).

Can I use this from my favorite JavaScript framework or on the backend?

Not yet. Send us an email, if you are interested and we will reach out to you as soon as it is there.

Do you have a dashboard or something like that?

Not yet. We will build one eventually, and you will at minimum get some information about all decisions and success events once we reach out with the bill, but for now we’re first going to focus on tuning our algorithms/models.

I have another question?!

Feel free to reach out and we will get back to you as soon as possible.