Telerik blogs

 By: Mehfuz Hossain and Stephen Forte

One of the benefits of modern web and mobile applications is that you can make changes to the app very quickly and rapidly deploy the new build. Some sites boast that they deploy new changes every few minutes. Compared to the past where you only got new updates once a year, if that often, we are operating in a very fast environment. As a result of this breakthrough, you can now incorporate user data to optimize your website or mobile app based on usage data.  

For example, let’s say you want to change the layout of a page, the color and text of a “buy now” button or experiment with different pricing. In the past, you would have to do focus groups, hire UI “experts,” and at the end of the day, guess what the users will do. Today, you can “A/B” test to optimize the user experience based on actual data. For example, if you are debating between a few different versions of a button and the media to display in order to increase your conversion rate (aka, make more money), why not randomly display all of your variations to the users of your web site and then go with the one that is most popular? This is exactly what the Obama Campaign did in 2008 and raised $60 million in campaign contributions as a result. While this is easy to do on a website (Google has been doing it for almost 15 years), it is not so easy to do with a mobile app. Enter the Telerik partnership with LeanPlum.


Telerik Partnership with LeanPlum

LeanPlum provides powerful A/B testing for your mobile apps. LeanPlum makes it easy for product managers and marketers to conduct on-the-fly A/B tests and see immediate results with powerful analytics. With the traditional approach where you have to go through the painful app store approval process before you validate a feature or flow, LeanPlum makes it easy by letting you define attributes right into your app that enable you to validate a feature almost instantly.

Telerik believes in developer productivity and recently worked with LeanPlum to release the  LeanPlum Cordova plugin in the Telerik verified plugin marketplace.

To benefit from the awesome features the LeanPlum plugin offers to A/B test your mobile application, you need to do following:

  • Register at LeanPlum and log in
  • Create an application and setup keys which you need later to configure your plugin.

  • Install the plugin in an AppBuilder project from

  • If you want to send push notifications using LeanPlum, you also need to upload push certificates obtained from apple developer portal to receive push in  Apple mobile devices.

Leanplum-verified plugins marketplace

Once the plugin is installed and configured, in the deviceready event you need to initialize Leanplum in the following way:

document.addEventListener("deviceready", function () {
  // Calling 'start' will run your app in production mode.
  // Call 'enableDebugging' before calling 'start' to run this session in developer mode.
      function(msg) {console.log("Started Leanplum. Message was: " + msg)},  // success handler
      function(msg) {alert("ERROR, Leanplum did not start: " + msg)}  // error handler

Now, I am working on an app that keeps me notified of the local trends. I am designing my home screen and not sure if a Facebook login can draw more users to the app.  So I’ve decided to do a quick A/B test to validate my assumption.


 The home screen looks like this:

home screen example



    In addition to default insight into app usage, Leanplum also lets you track custom events. Therefore, I have added LeanPlum.track in click events for all three actions which looks like this:

        function(msg) {alert(msg)}, // success handler
        function(msg) {alert("ERROR, not tracked: " + msg)}, // error handler
        "Login with Facebook"

    Once done, I then went to LeanPlum’s online dashboard and configured the criteria I am interested in:

    Facebook Signin-Telerik Platform LeanPlum Example


    Here I have set a goal that will, over the course of time, help me understand what percentage of users in my app have Facebook account and whether giving them an email signup option is relevant at all. The great thing is that I can now experiment with loads of scenarios and their results without a single line of code change.

    Now, the feature that makes LeanPlum even more compelling is the ability to send push notification which is absolutely mind blowing as you consider doing user re-engagement.

    To send push once LeanPlum is initialized, device is registered in the following way:

      "badge": "true",
      "sound": "true",
      "alert": "true",
      "callback": "onPushNotificationReceived"
    // the callback we configured a few lines back
    function onPushNotificationReceived(e) {
      alert("Push Notification received: " + JSON.stringify(e));

    In the same app that I have mentioned above. I now can nudge users for a given criteria almost instantly from LeanPlum online dashboard:

    New Feature Re-engagement- Telerik Platform LeanPlum Example


    Here, whenever the location changes it will notify users of the top trending event running in that particular city through push notification. This lets companies or app developers engage with users in a whole new way and keep them up-to-date on perks based on numerous combinations without a single round trip to app store.

    In this post, we have shown how easy it is to take the advantage of A/B tests in a hybrid app using the new Telerik LeanPlum Cordova plugin. We have shown ways you can use it to decide on a feature, and do feature re-engagement through push notification without adding any special checkpoints in the app. Happy A/B testing.

    About the Author

    Steve Forte

     sits on the board of several start-ups including Triton Works. Stephen is also the Microsoft Regional Director for the NY Metro region and speaks regularly at industry conferences around the world. He has written several books on application and database development including Programming SQL Server 2008 (MS Press).


    Comments are disabled in preview mode.