Last modified April 19, 2017 by Shelly Wolfe

How Do I Get Resource A/B Test Information from the Swrve SDK?

It is now possible to get the resource A/B test and variant IDs directly from the Resource Manager in the Swrve SDK in real-time for use in your third-party reporting systems.

To have this feature enabled for your app, contact your Customer Success Manager at support@swrve.com, and then use the following code to get the resource A/B test information from the Resource Manager in the Swrve SDK.

Android


Step 1: Configure the SDK to obtain the AB Test details when initializing.

Step 2: Obtain the details from the Resource Manager.

iOS


Step 1: Configure the SDK to obtain the AB Test details when initializing.

Step 2: Obtain the details from the Resource Manager.

Unity


Step 1: Configure the SDK to obtain the AB Test details when initializing.

Step 2: Obtain the details from the Resource Manager.

Example Output

Output Values

The highlighted lines in the above example are the exposed A/B test information and include the following details:

  • name – displays the A/B test ID and name that was given to the A/B test when it was created.
  • case_index – displays the A/B test case index. The case index indicates the A/B test treatment the user has been exposed to, with a number from 0 to N-1, where N is the total number of variants in the test. For example, in a test with three variants, the possible values would be 0, 1, 2.