1 of 20
2 of 20
3 of 20
4 of 20
5 of 20
6 of 20
7 of 20
8 of 20
9 of 20
10 of 20
11 of 20
12 of 20
13 of 20
14 of 20
15 of 20
16 of 20
17 of 20
18 of 20
19 of 20
20 of 20

doc

How to configure the Azion A/B Testing solution

Overview

The edge function A/B Testing is a serverless solution available at Azion Marketplace.

A/B tests solution allow the distribution of different scenarios to be better controlled during the test run, and to identify the most successful variants.

Some other benefits of A/B Testing as an edge function include:

  1. Creating multiple variants in a single JSON file (A, B, C, and more).
  2. Varying how traffic flows.
  3. Combining test rules with business rules (WAF, bot protection, and more).
  4. Improving the users’ experience. Compared to solutions that use JavaScript to perform A/B tests, the time it takes to load a page isn’t affected and is significantly faster.

How does the Azion Marketplace A/B Testing solution work?

Test settings are defined in the function using JSON format parameters, called Args, which list attributes related to each version being tested, such as probability, cookie value, and others.

The function’s algorithm distributes the request according to a defined probability when it arrives at one of Azion’s edge nodes. Then, it sets the cookie with the expiry time and the values specified for each variable. From that point on, all traffic from the client that made the request is redirected to the selected version.

When a new request is made by another client, a cookie is set and all traffic is redirected to other version (or even the same) according to the probability you set up. From this point on, all traffic from this client is redirected to this version.

The edge node then forwards the query to the originating application, which returns the content of the test page, and the edge delivers the content to the user.


Setting up A/B Testing

Edge Function A/B Testing is available from the Azion Marketplace and can be accessed through Real-Time Manager (RTM) through Products menu > Marketplace.

You can understand how to install and configure an A/B test solution by reading the How to install the A/B tests solution from Azion Marketplace guide on the documentation page.


Example of an A/B Testing JSON file configuration

Below is an example of what a JSON file configuration looks like for a basic A/B Testing function. In this particular case, the first variant is passed with a 90% (0.9) probability, and the second variant is passed with a 10% (0.1) probability.

Don’t forget that the sum of the two probabilities must always be 1.

{
	"param": {
		"cookie": {
          "name": "MYABTEST_NAME__",
          "expiration": "Wed, 04 May 2021 10:16:00 GMT",
          "max_age": 600,
          "domain": "localhost",
          "path": "/"
		},
        "a": {
            "cookie_value": "A_VARIANT",
            "prob": 0.9,
            "addresses_list": "www.mytest_ab_of_my_site.com:443",
            "originid": "uuid1",
            "live_ingest": false,
            "protocol_policy": "https",
            "path": "",
            "cache_key": "test_a",
            "host": "localhost"
        },
        "b": {
            "cookie_value": "B_VARIANT",
            "prob": 0.1,
            "addresses_list": "www.mytest_ab_of_my_site.com:2010",
            "originid": "uuid2",
            "live_ingest": false,
            "protocol_policy": "https",
            "path": "",
            "cache_key": "test_b",
            "host": "localhost"
        }
	}
}

Defining the rules on Rules Engine

The set of conditions that must be met for behaviors to be executed are determined by the rules in the Rules Engine. You can use the Default Rule to run your function with no conditions, or create a new rule to configure trigger conditions of your function.

Defining validation criteria

Choose the variables, comparison operators and strings to create your business rule, as in the following example:

  • If: ${uri} is equal /home

Logic: logical operator, variable, comparison operator, string.

This rule is executed if the URL accessed is equal to the string mypagetotest.com/home.

Defining validation behaviors

Add the behaviors you want to be carried out when the rule’s conditions are met, as in the following example:

Then: Run Function MyABTestFunction

Logic: logical operator, action, function.

In this example, if the conditions defined in the rules are satisfied, then the function MyABTestFunction will be executed.

Finally, save your edge application and the new function will be ready.


Didn’t find what you were looking for? Open a support ticket.