Android manual approach

Initialize SDK

Put the following code in your app delegate:

MMTApi api = MMTApp.getApi(context, "myapp");

api.setSandbox(true);

Replace "myapp" with the name of your Site in the Oracle Maxymiser UI.

Later, you can refer to the first created API by MMTApp.getDefaultApi(), so there is no need to keep the reference to the created API.

Note: You do not have to initialize API if you initialized SDK with No Store Update approach.

Create campaign

We have provided a number of links to our current Oracle UI documentation which references our Oracle Maxymiser UI for web site tests, this is also where you will set up and maintain mobile app tests.

Set up a campaign for testing:

  1. Create a Max Test campaign – full documentation can be found in our Help guide at these locations: EU Customers, US Customers.
  2. Map your campaign to the Page that has been created in the Oracle Maxymiser UI for app testing – full documentation can be found in our Help guide at these locations: EU Customers, US Customers. Please ensure that you do not map your campaign to other Pages because the predefined Page has special properties set for App testing.
  3. Create at least one Action that you would like to track inside your application – full documentation can be found in our Help guide at these locations: EU Customers, US Customers.
  4. Create an Element which will contain variants of your user experience - full documentation can be found in our Help guide at these locations: EU Customers, US Customers.
  5. Create at least one Variant for an Element of your user experience – full documentation can be found in our Help guide at these locations: EU Customers, US Customers.
  6. Specify Variant Weight and control – full documentation can be found in our Help guide at these locations: EU Customers, US Customers.

For example:

We would like to change the background color and verify which one has the higher conversion rate. Create two variants of your user experience in addition to Default as this is created automatically. The Default variant (Control variant) has a white background.

Variant 1 has a green background and variant 2 has a blue background.

Now we need to set up variant weightings.

Default: 50%

Variant 1: 25%

Variant 2: 25%

This means that half of all users do not see any changes in Oracle Maxymiser UI, and won’t participate in the campaign. A quarter of users see the green background and a quarter the blue background.

Fetch experiences

The code below will fetch and cache all campaigns and their variants for later use.

// Show interstitial page

MMTApp.getDefaultApi().fetchExperiences(new MMTApi.FetchExperiencesHandler() {

@Override

public void onExperiencesFetched() {

// Hide interstitial page and display Home page

}];

The first argument is a handler that we will invoke once experiences are fetched. It is safe to update UI inside this handler as it will be invoked on the main thread.

Note: Due to latency there may be a short delay in receiving a response from Oracle Maxymiser with details of the variants to display. Therefore, we recommend fetching experiences in a place in your app where a user may naturally experience a delay, such as an interstitial page or a search term/login input page. We recommend fetching experiences at the app launch.

Content transformations

When experiences are fetched, you can use them to transform content. There are two methods you can choose from to implement content transformations.

Variant Name Variant Content
Default Empty
Variant1 Empty
Variant2 Empty
@Override
protected void onResume() {
    super.onResume();
    Experiences experiences = MMTApp.getDefaultApi().getExperiences();
    int color = Color.WHITE;
    if (experiences != null) {
        String variantName = experiences.getVariantName("Campaign", "View");
    if (variantName.equalsIgnoreCase("Variant1")) {
        color = Color.GREEN;
    } else if (variantName.equalsIgnoreCase("Variant2")) {
        color = Color.BLUE;
    }
    }
    View view = this.getWindow().getDecorView();
    view.setBackgroundColor(color); MMTApp.getDefaultApi().trackContentSeen("Campaign");
    }

Important: Make sure that experiences are applied each time the UI is presented to the user, as experiences may change as a result of tests stopping or personalization logic.

Variant content

You can describe content transformation in variant content. Variants of the user experience for the View element would be use the format showing in the following example.

Variant Name Variant Content
Default whiteColor
Variant1 greenColor
Variant2 blueColor
@Override
protected void onResume() {
        super.onResume();
        Experiences experiences = MMTApp.getDefaultApi().getExperiences();
        int color = Color.WHITE;
        if (experiences != null) {
        String variantName = experiences.getVariantName("Campaign", "View");
        if (variantContent != null) {
        color = Color.parseColor(variantContent);
        }
        }
        View view = this.getWindow().getDecorView();
        view.setBackgroundColor(color);

Important: When a user is shown content from a campaign, Oracle Maxymiser platform must be notified by calling [[MMTApp defaultApi] trackContentSeen: %CampaignName%];

Failure to perform this step means that reporting will be distorted since no users are recognized as entering campaign.

Action tracking

All testing campaigns require at least one action, such as tracking a conversion to sale, so that you can track the impact of altering a user experience.

Use the following code to track an action:

MMTApp.getDefaultApi().trackAction("Purchase", 100, null);

If the connection to Oracle Maxymiser is not available, action will be cached and sent once connection resumes.

Personalization and targeting

By default, all app users are included in campaigns and are served its content variants randomly. Alternatively, campaign targeting can be used to display specific variants to users based on their attributes. This behavior is defined using segment rules in the Oracle Maxymiser user interface.

Create segment rule

  1. Add a new segment rule - full documentation can be found in our Help guide.
  2. Define Content Served using Experiences - full documentation can be found in our Help guide.

Set custom user attributes in the app

Once the custom attributes are created, use the following code to set user attributes:

[MMTApp setUserAttribute:@"AttributeName" value: @"AttributeValue"];

When you set or change a user attribute you should fetch the latest experiences using the code below:

// Show interstitial page
MMTApp.getDefaultApi().fetchExperiences(new MMTApi.FetchExperiencesHandler() {
        @Override
        public void onExperiencesFetched() {
// Hide interstitial page and display Home page
}];

Important: Do not fetch experiences while a campaign is live. This distorts reporting since users will see more than one experience.