New Beta Feature: Expose A/B test names

Thank you for being a beta tester for one of our newest features! Your feedback is essential to the continued improvement of the Leanplum platform. 

We're excited to present this new beta feature in our API: Exposing A/B test names.

Overview

The Leanplum API includes a getVars method that allows you to view the variables, messages and A/B test variants for a single user, or the defaults for all users (if you do not pass a deviceId or userId). While this is extremely useful, the method by default does not return the abTestId or abTestName, which means you need to make an additional API call to get that information.

With this feature enabled, however, getVars will return the variant id, name, abTestName, and abTestId.

Important: Remember that the name and abTestName can be changed at any time in the Leanplum dashboard. For data tracking or analytics, it's best to use the id and abTestId, since those values will remain static.

variantName.png

Example response

The default response will only only include the id:

{
    "response": [
        {
            "vars": {},
            "interfaceRules": [],
            "variants": [
                {
                    "id": 6283916448600000
                }
            ],
            "regions": {},
            "success": true,
            "messages": {},
            "interfaceEvents": []
        }
    ]
}

With this feature enabled, getVars will return:

{
    "response": [
        {
            "vars": {},
            "interfaceRules": [],
            "variants": [
                {
                    "id": 6283916448600000,
                    "abTestName": "Welcome Message Test",
                    "abTestId": 5164114791311111,
                    "name": "Yo Variant"
                }
            ],
            "regions": {},
            "success": true,
            "messages": {},
            "interfaceEvents": []
        }
    ]
}
Note: Enabling this feature returns your A/B test and variant names in the Leanplum.start response. Since variants and tests can be given any name by your admins in the Leanplum dashboard, consider this before enabling this feature.

If you are interested in this feature, speak to your CSM for details, or email support@leanplum.com


Was this article helpful?
Have more questions? Submit a request