The Amazon A/B Testing service is an effective tool to increase user engagement and monetization. It allows you to set-up two in-app experiences (each of which is presented to a different group of users) and evaluate the success of each, based on criteria you establish. Another, less obvious, use of the A/B testing service is feature timing. It’s easy to turn on a new feature at a specific time, or release a series of features on a schedule. You can do it in four simple steps, which I walk through here:
Step 1: Creating a new A/B project and launch used for releasing a feature
Using the Amazon A/B Testing service requires an Amazon developer account and an Android app associated with the account. If you don’t already have a developer account you can sign up here. The first step for using Amazon’s A/B Testing to release a feature is to create an A/B launch used to determine whether the feature in your app is hidden from users or accessible by them. Once signed into your developer account the following steps can be used to accomplish this:
Step 2: Integrating the SDK and API into your Android app
We now have an A/B launch containing a corresponding variable for determining whether our feature is made available. The next step is to integrate the A/B Testing SDK into our app using the following steps so we can write code to obtain whether the feature is made available.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application>
...
<service android:name="com.amazon.insights.InsightsProcessingService" />
</application>
Step 3: Adding the Java code necessary to enable your feature based on the A/B launch
With the SDK setup its time to add code to either make our feature hidden or available based on the variable we configured for our A/B launch. The steps below detail the code needed for accomplishing this.
import com.amazon.insights.*;
AmazonInsights
.withApplicationKey(YOUR_APPLICATION_KEY)
.withPrivateKey(YOUR_PRIVATE_KEY)
.withContext(getApplicationContext())
.initialize();
//Get our “Feature Launch - FeatureName” experiment and retrieve the variable
//for whether the feature is made available.
ABTest
.getVariationsByProjectNames("Feature Launch - FeatureName")
.withVariationListener("Feature Launch - FeatureName", new VariationListener() {
public void onVariationAvailable(Variation variation) {
boolean featureNameEnabled = variation. getVariableAsBoolean(
"FeatureName_IsLive", false);
if (featureNameEnabled) {
enableFeatureName();
}
}
});
Step 4: Releasing your feature via Amazon’s A/B Testing portal
With your app now supporting the release of the feature, the final step is to make your feature available at the appropriate time. This can be done completely via the Amazon A/B Testing portal and doesn’t require an APK update with the feature enabled. To launch the feature use the following steps:
When the Launch was created the distribution was set to 100% to the “Old Version”. Change the distribution of the new variation to 100%. All users of your app are going to receive true for the variable used to enable your feature. Click “Save Launch” and your feature will now be live for all users.
In some scenarios you might want to incrementally release a new feature over time. This can beneficial when releasing features for which scaling might be a concern. For example, you can use Launch to safely increase the percentage of customers receiving the feature while you monitor the scalability of your service. If a problem is detected you can stop incrementing the release or in an extreme case pull it back.
That is all it takes to support releasing a feature via Amazon A/B Testing in your Amazon app. You can find more information the Amazon A/B Testing service here.