Use Cases

Variant AIM ServerProduct ⟫ Use Cases

Common Use Cases

1. Ecommerce Application: Free Shipping Experiment

Offer free shipping to non-promo customers on orders over a threshold amount. Run multiple variants of the offer to determine the most cost-effective threshold amount. This use case highlights the following Variant concepts:

  • Creation of a multi-variant experiment.
  • Developing and configuring a custom qualification hook in order to disqualify certain user sessions from the experiment

Server Side

If a user session originated as a click or touch on an on-line ad or an email promo, we want to exclude it from the experiment because it may be already responding to a promotion. Disqualified sessions are sent to the control experience (no free shipping offer) and generate no tracing. This is different from qualified sessions which were randomly targeted to the control experience, because in-experiment sessions generate tracing regardless of the experience.

The metadata for this experiment will look like the schema on the right. User sessions qualified for the experiment will be targeted to either control or one of four variant experiences randomly, with probability weights of 96% and 1% respectively. The experience designer chose minimal purchase amounts to qualify for free shipping at $25, $50, $100, and $200, though you may choose other amounts. The onStates section will contain one entry per each instrumented page.

In order to disqualify promotional sessions, a custom qualification hook PromoDisqualifierHook is configured.

Qualification hooks are posted by the VariationQualificationLifecycleEvent whenever a new user session must be qualified for a variation. Qualification hooks are part of the server-side extension SPI (Java), which provides application developer with a way to neatly encapsulate and reuse application-specific instrumentation related code. There are other lifecycle events that can be subscribed to by event hooks. Custom hooks are compiled independently of the host application into JAR file(s), which are made available to the host application when placed into the server’s /ext directory.


  // ... Meta and states sections
  'variations':[                                                 
    {                                                      
      'name':'FreeOfferTest',
      'experiences':[                                     
        {                                                
          'name':'existing',                                   
          'weight':96,                                  
          'isControl':true                              
        },
        {                                                
          'name':'USD25', // $25 min purchase offer                   
          'weight':1                                   
        }, 
        {                                                
          'name':'USD50', // $50 min purchase offer         
          'weight':1                                   
        }, 
        {                                                
          'name':'USD100', // $100 min purchase offer          
          'weight':1                                   
        }, 
        {                                                
          'name':'USD200', // $200 min purchase offer         
          'weight':1                                   
        } 
      ],                                                  
      'onStates':[
        // ... State information
      ],
      'hooks':[
        {
          // Posted by to VariationQualificationLifecycleEvent
          'class':'com.mydomain.variant.PromoDisqualifierHook'
        }
      ]
    }                                    
 // ... Other variations

package com.mydomain.variant;
// ...
public class PromoDisqualifierHook implements LifecycleHook {
   
   // Extend type param to runtime.
   @Override
   public Class getLifecycleEventClass() {
      return VariationQualificationLifecycleEvent.class;
   }

   // Lifecycle event raised.
   @Override
   public Optional[LifecycleHook.PostResult] post(
      VariationQualificationLifecycleEvent event) 
      throws Exception {
	
     VariationQualificationLifecycleEvent.PostResult result = null;
     String isPromo = event..getSession()getAttribute("isPromo");
     if (isPromo != null) {
       result = event.mkPostResult();
       result.setQualified(Boolean.parseBoolean(isPromo));
     }	
     return Optional.ofNullable(result);
   }
}

Client Side

Variant server has no way of knowing whether a particular user session is promo or not, so the hook relies on the host application to figure that out and set a Variant session attribute. which will be thus available to the server-side hook code on the right.


Session variantSsn = 
  connection.getOrCreateSession(httpRequest);
variantSsn.getAttributes.put("isPromo", String.valueOf(isPromo()));

Support for Play applications is coming soon.

Support for JavaScript is coming soon.

2. Interactive Voice Response (IVR) Integration: Synchronize Online and Call Center Experiences

When you roll out a new feature on your online mortgage application, you also want to make corresponding changes to your support center’s inbound telephone menus, so that the customer’s phone experience will match his online experience. Preservation of a user’s targeting information between sessions is called durable targeting. It must be specified explicitly in the variation schema in order to override the default stable targeting (which preserves targeting information for the duration of Variant session, but not between sessions). This use case highlights the following Variant concepts:

  • Durable vs stable targeting.
  • Heterogeneous distributed applications.

Server Side

Note, that your states list must contain both your Webapp’s pages and the phone menus that are part of this experiment. Note as well the durable targeting property.


  // ... Meta section
  'states':[
    // ... Include web app pages and phone menus.
  ],
  'variations':[                                                 
    {                                                      
      'name':'FooTest',
      'experiences':[                                     
        {                                                
          'name':'existing',
          'weight': 99,                      
          'isControl':true                       
        },
        {                                                
          'name':'new',
          'weight': 1                  
        }
      ],
      'targeting':'durable',                               
      'onStates':[
        // ... State information
      ],
      'hooks':[
        {
          'name':'IvrTargeter',
          'class':'com.mydomain.variant.IvrTargeterHook'
        }
      ]
    }                                                     
 ]                                                         
 // ... Other variations

Client Side

Assuming you have code-level access to your call center software, you can include it into the experiment by using the appropriate native Variant client library to connect to Variant server. Both the Web app and the call center will instantiate their Variant sessions using the optional second parameter, identifying the session, which is required with the durable targeting setting.

Session variantSsn = 
  connection.getOrCreateSession(httpRequest, userId);
Support for Play applications is coming soon.
Support for JavaScript is coming soon.