How to install the A/B Testing integration through Azion Marketplace

Mainly, you can use A/B tests to validate certain addresses, interfaces, or even workflows. Tests enable you to experiment with variations and how they work with your users, providing two options to access certain content or complete task.


To use the A/B test integration provided through Azion Marketplace, access Azion Console and go to Marketplace.

On the Marketplace homepage, select the integration’s card.

Once the integration’s page opens, click the Get It Now button, at the bottom-right corner of the page, and a successful message appears to confirm your integration is installed.


Being an Edge Application function, A/B Testing runs tasks and services on the edge, employing an existing edge application.

Follow the next steps to instantiate the integration.

  1. On the upper-left corner, select Products menu > Edge Application on the BUILD section.
  2. On the listing page of your edge applications, select the one you want to use with the integration.
  3. On the application page, open the Main Settings tab.
  4. Enable the Edge Functions and Application Accelerator switches to activate these modules.
  5. Click the Save button.

A successful message appears informing that the edge application has been updated.


To configure the JSON file, you’ll have to register the origins (websites) you want to redirect your integration. These origins will receive a unique ID called Origin Key.

Still on the page of the application, follow these steps:

  1. Go to the Origins tab.
  2. Click the Add Origin button.
  3. Give an easy-to-remember name to this origin.
  4. Select Single Origin for the type of origin.
  5. Select ${host} for the Host Header option.
  6. You can pass an Origin Path, but this is optional.
  7. Choose the protocol you want to use: HTTP, HTTPS, or preserve to preserve the original protocol.
  8. Pass the URL you want to register for this origin.
  9. Click the Save button.

After you save it, you’ll be able to see the Origin Key generated by Azion Console for the origin you’ve registered. This will be used to fill the originid field on the Arguments box of the function.


Still on the page of the application, follow these steps:

  1. Select the Functions tab.
  2. Click the Add Function button.
  3. Choose an easy to remember name for your function.
  4. On the dropdown function menu, select the A/B Testing [Global] function.

This action will load the function, showing a form with the function’s code and, just above it, two tabs: Code and Arguments.

On the Code tab, you’ll be able to navigate through the code, but won’t be able to change it. On the Arguments tab, you’ll pass the parameters.

Select the Arguments tab to open the form where you can add the parameters to execute your application.

The form will load the parameters as below:

{
"param": {
"cookie": {
"name": "azion_abtest",
"expiration": "Wed, 04 May 2011 10:16:00 GMT",
"max_age": 600,
"domain": "localhost",
"path": "/"
},
"a": {
"cookie_value": "A_TEST",
"prob": 0.5,
"addresses_list": "localhost:2006",
"originid": "uuid1",
"live_ingest": false,
"protocol_policy": "http",
"path": "",
"cache_key": "test_a",
"host": "localhost"
},
"b": {
"cookie_value": "B_TEST",
"prob": 0.5,
"addresses_list": "localhost:2010",
"originid": "uuid2",
"live_ingest": false,
"protocol_policy": "preserve",
"path": "",
"cache_key": "test_b",
"host": "localhost"
}
}
}

Where:

VariableDescription
nameThe name of the cookie you’ll choose. Give a unique and easy-to-remember name
expirationThe expiration date of the cookie
max_ageThe time, in seconds, for the lifespan of the cookie
domainThe domain where you’re running the tests
pathThe subdomain to the cookie. You can use / to set the subdomain to all the domains

On the second section, called a, you can add the parameters to the first test, and then repeat it for the rest of the tests:

VariableDescription
cookie_valueA value to identify the cookie for this test variation
probThe probability to send this address to the user. This value should be between 0 and 1, with 0 being 0% of chance and 1 being 100% of chance
adressess_listThe address for the a test. Example: www.mytest_ab_of_my_site.com:443
originidThe identification ID for the origin. This will be automatically generated by Azion Console
live_ingestIt indicates if the origin is a live streaming. A boolean value should be used here: true or false
protocol_policyTo force HTTP or HTTPS, or even keep the default value by passing the preserve value
pathIt indicates the subdomain of the cookie. You can leave it blank, "", to indicate that it’s valid for all domains
cache_keyA name to identify the cache. It should be unique and you can’t repeat it elsewhere
hostThe name of the host that the requisition sends

In Rules Engine, you’ll pass the criteria and behavior to run the integration.

Still on the page of the application:

  1. Select the Rules Engine tab.
  2. Click the Default Rule.
    • Note that you can’t change or configure the criteria for the Default Rule.
  3. On the Behavior field, choose Run Function and, from the dropdown menu, choose the A/B Testing integration according to the name you gave it.
  4. Add another behavior by clicking on the + button right bellow the first one.
  5. Pass the first behavior: Bypass Cache.
  6. Click again on the + button bellow the second behavior.
  7. Pass the second behavior needed: Forward Cookies.
  8. Click the Save button.

Done. Now you’ll have to wait a few minutes for the edge application to propagate through Azion’s edge nodes.

go to How to configure A/B Testing reference

Contributors