Panchaksharappa, Varuna

This document details the process of reviewing mPulse with your Android application. It is assumed that you have already read the mPulse Configuration Guide and are familiar with the features and configurations available with the SDK.

Before using the mPulse Android SDK, you will need to have a mPulse app and an associated API Key. Once your app has been configured in mPulse, you can use the mPulse Android SDK.

 

 

Step 1: Network Monitoring

 

Once included in the project, mPulse will automatically instrument all network requests. Network requests will be instrumented as long as they are sent from one of the following classes (or a library that uses one of these classes):

 

  • java.net.URLConnection

  • com.squareup.okhttp.OkHttpClient version 1.x

  • okhttp3.OkHttpClient version 3.x (after version 2.2.0)

 

For OkHttp, Retrofit use wrappers provided :

Below are the usages of the same :

   1. Retrofit :

retrofit wrapper usageretrofit wrapper usage

 2. OkHttp :

okhttp wrapper usage

 

To verify if the network is being instrumented, check the Logs: 

Pic3

 

Next open Soasta portal - https://mpulse.soasta.com/concerto/Central and click on Summary

 

Pic4

 

Choose an app from the DropDown as shown below and choose the time as the last 1 hour or 3 hours depending on your requirement.

 

Pic5

 

mPulse sends requests every 60 seconds, you can see the spikes for the network calls as shown below. In the image, it shows the number of Page Views and Page Load time for the network request.

 

Pic6Pic7

You will also be able to get more details about the requests.

 

Pic8

 

Troubleshooting :

  • Ensure you are using the correct mPulse API Key in akamai_sdk_init.

  • Ensure you’ve updated your AndroidManifest.xml with the correct permissions.

  • Make sure you have added right wrappers to the API calls/ Image requests.

 

Step 2: Action Beacons

 

The mPulse Android SDK allows you to monitor Actions, which are distinct user interactions. Actions can be started at any time by calling startAction and can be stopped by either calling stopAction or by having the SDK automatically stop the Action once all network activity has finished.

 

  • Below is how you call Start and Stop actions :

 

MPulse.sharedInstance().startAction("mPulseDemoAction");
//Network Calls
MPulse.sharedInstance().stopAction();

 

  • Open Waterfall report and check the Beacon details

Pic9

 

Troubleshooting: Follow the same steps as Network Monitoring.

 

Step 3: Custom Metrics

 

  • Add Metrics in the App Config of the Soasta portal :

 

Pic10

 

In the above figure, Metrics is added as M_MainScreen and M_SplashScreen and currency as USD, Percent Decimal Places is set to 2 and Currency Decimal Places is set to 2.

 

  • Below is how you send the metric :

 

MPulse.sharedInstance().sendMetric("M_MainScreen", 20);

 

Open App Summary → sent results can be seen in the Summary section of the dashboard :

 

Pic11

 

Troubleshooting :

  • Make sure you have added Metrics in the App Config of the Soasta portal.

  • Make sure the name that you have added for the metrics(portal) and the name that you are sending from the sendMetric() are the same.

Eg: In Portal Added Metrics name: M_SplashScreen.

       From App : sendMetric(“M_SplashScreen”, value)

  • Note that you may also need to select the custom metric that you want to show in summary, which can be done via settings that are located to the top right corner in the summary section.

 

Step 4: Custom Timers

 

  • Add Timers in the App Config on the Soasta portal :

 

Pic12

 

  • Below is how you send the timer :

 

String timerID = MPulse.sharedInstance().startTimer("mPulseDemoTimer");
 

//Network Calls
MPulse.sharedInstance().stopTimer(timerID);

 

Once sent the same result can be seen on the dashboard :

 

Pic13

Troubleshooting :

  • Make sure you have added Timers in the App Config of the Soasta portal.

  • Make sure the name that you have added for the Timers(portal) and the name that you are sending from the startTimer() both are the same.

Eg : In Portal Added Timer name : mPulseDemoTimer.

       From App : startTimer(“mPulseDemoTimer”)

  • Also, make sure to call stopTimer() once you are done with your network requests.

 

Step 5: View Groups

 

You may want to segregate reports based on view. Once set, the View Group will be associated with every subsequent beacon.

 

MPulse.sharedInstance().setViewGroup("mPulseDemoDashboard");

 

Select Group name from the dropdown. Upon selecting a Group, the report will show only network calls associated with that Group.

 

Pic14

 

Step 6: Custom Dimensions

 

You may want to add a dimension to your data. For example, you may want to filter out customers who are Gold or Silver users.

  • Below is how you add the Dimension based on your logic.

 

MPulse.sharedInstance().setDimension("CardType", "Gold");
//Network Calls

 

  • Select type based on Dimension set in the above code. Here Dimension is set as CardType and value is set to Gold.

Pic15