Skip to main content
All CollectionsFor Mobile App
Mobile App Testing - Full Guide
Mobile App Testing - Full Guide
James Harber avatar
Written by James Harber
Updated over 7 months ago

Introduction

Webtrends Optimize facilitates running experiences inside of Mobile Apps, both native, hybrid and in framework-based apps like React Native.

This works very similar to Server Side testing, and if you haven't read that document we suggest reading that first.

It will provide a full guide to using the API, but we will describe the mobile-app approach in this document.

We offer you a REST API to use for decisions, and pass along useful data in the response body. There are currently no active SDKs for experimenting in mobile apps.

You will need to write the code to achieve this. We will guide you through what needs doing, but without providing code given the wide landscape of how mobile apps are built.

Approach

When to fetch experiences

This is the first point to consider. For mobile apps, where signal can be intermittent, we recommend fetching all decisions at once on app initialisation. Use the "Fetch all projects" variant of the control request for this.

Alternatively, if you wanted to fetch tests only when needed, perhaps to ensure segmentation criteria is available, you can use the Fetch Specific Project variant of the control request.

Storing the decisions

This comes next. There are two aspects to consider here:

  1. Making sure each decision is easy to lookup. In response.body.factors[0].value, you'll see the value. And response.params.testAlias give you the lookup-key.
    ​
    We recommend storing these both in-memory and in your app storage.
    ​

  2. Storing "cookies".
    ​
    Data referred to as "cookies" in the API response will be returned back to you, to help preserve decisions and assign behaviour to users. This needs to be saved and retrieved when interfacing with the API.

Reading flags

If you have handled the first point above correctly, you should have created an easy mechanism to read-back the decisions.

In React Native apps, for example, this could be state management with a Context wrapping your application, for which you can then deploy Consumers to read the decisions.

Metric capture

You will need to pick the steps in your application where you want to capture metrics, such as key screens loading, key buttons being pressed, and key actions taking place.

For an e-commerce application, this could be metrics such as Add to Bag clicks, Checkout steps loaded, and Purchase/Revenue metrics.

You should capture metrics using the approach detailed in the API guide.

Did this answer your question?