As a developer, in our rush to build and deploy our apps, it can be easy to overlook the importance of integrating analytics into our mobile applications. However, this short-sightedness can lead to problems down the road. Analytics can not only help us find places where things may be going wrong in our application, but can also help us to better understand how users are actually using the application so that we can refine or add new features to improve their experience over time.
Recently, Telerik announced the public availability of Telerik Analytics for Apache Cordova. This plugin supports Android, iOS, and Windows Phone 8 and is available via the Cordova Plugins Registry. In this article, I will take a look at what the Telerik Analytics service is, how it works and how you can integrate it into your apps to track key aspects of things like usage and errors.
Telerik Analytics is a service that provides detailed application analytics. It accomplishes this task through a lightweight monitor that’s integrated into your Cordova application:
It allows you to track a number of aspects of your applications across multiple platforms, including:
Once these analytics are gathered by the monitor, a set of detailed reports are auto-generated and available for you to examine:
These reports are essential for gaining deeper insights about how your application is used.
Integrating Telerik Analytics into your application is pretty simple. First, create an account at platform.telerik.com. We provide a fully-featured, 30-day starter subscription when you sign up. A name, email address, and company name is all that’s required to get started.
Telerik Analytics supports a wide variety of platforms:
For Apache Cordova applications, select “AppBuilder for Hybrid AppBuilder Applications” to create the project. Once created, everything is ready with the analytics service.
Telerik Analytics uses an integrated monitor to collect analytics about your application. This monitor operates in the background and is easily integrated by installing the plugin for Telerik Analytics via the Apache Cordova CLI:
$ cordova plugin add com.telerik.plugin.telerikanalytics
The plugin configuration will request access to **.monitor-eqatec.com*, the reporting endpoint for Telerik Analytics. It will also request
INTERNET permissions for Android. If you’re targeting Windows Phone 8, the plugin will request
ID_CAP_IDENTITY_DEVICE application capabilities.
Once the plugin is installed, you’ll need to initialize this monitor, which is typically done after the
deviceready event fires:
var analytics = window.plugins.EqatecAnalytics; var settings = analytics.Factory.CreateSettings("YOUR-PRODUCT-ID", "YOUR-APP-VERSION"); analytics.Factory.CreateMonitorWithSettings(settings, monitorCreated, monitorCreationFailed);
After the monitor is initialized, you can begin tracking your application via its
Start method. Conversely, you can end tracking via its
Stop method. When the monitor is started, it will profile the device’s runtime environment and await calls to track exceptions and features of your application. This can be done through methods like
There are other methods exposed by the monitor. However, these methods (above) are the most likely ones you’ll use. For more information about the monitor API, please refer to the documentation.
Once you understand the process of integrating the monitor into your application, the next step is to consider the sorts of things you’d like to track. Generally-speaking, we recommend monitoring the following four (4) types of metrics:
Recently, we published an article post entitled, Application Metrics You Should Monitor Constantly. It highlights the motivations for tracking these metrics. I would recommend reading it prior to integrating trace statements throughout your application. For applications built with PhonaGap/Apache Cordova, you could track some of the following metrics:
The monitor is quite flexible in terms of tracking these and other metrics you’re interested in capturing.
Telerik Analytics is a run-time application analytics service, which supports 13 platforms for monitoring web, mobile and desktop applications. You can integrate the Telerik Analytics plugin for Apache Cordova to start gaining valuable insights about your applications. Start your journey by registering for your free, 30-day account by visiting platform.telerik.com.