• /
  • Log in
  • Free account

Introduction to New Relic for Cordova

The official New Relic Cordova plugin for iOS and Android allows developers to easily embed the mobile agents into Cordova applications. Written in JavaScript, the plugin automatically includes New Relic's native agents to provide mobile monitoring and performance visibility.


The New Relic Cordova plugin will:

  • Detect the platforms added to your Cordova application and apply the most recent release of the appropriate New Relic mobile agent (Android or iOS).
  • Add post-build scripts for uploading iOS symbolication files.
  • Upload Android Proguard mapping files.
  • Automatically instrument mobile applications built via Cordova.

For more information, see New Relic Cordova Plugin on Github.

Compatibility and requirements

The New Relic Cordova plugin requires:

Network requests are only recorded on iOS devices for webviews and native frameworks. Android only records native network calls.

Cordova will typically handle exceptions by default. Our Cordova plugin will record uncaught exceptions (crashes) that Cordova does not handle.

Install the Cordova plugin

Before installing, make sure you have fulfilled the prerequisites for adding the Android or iOS platform to your Cordova project. Then follow these steps to install the Cordova plugin:

  1. If you do not already have an account, signup (it's free).

  2. If applicable, use separate application tokens for iOS and Android.

  3. From your New Relic applications page, copy the application tokens for the Cordova platforms you are building on.

  4. Change to your Cordova project directory, then add the plugin to your project with the Cordova command line tool. Use the --variable argument to pass application tokens to the plugin:

    # Install from github repository
    cordova plugin add https://github.com/newrelic/newrelic-cordova-plugin.git --variable IOS_APP_TOKEN="{ios-app-token}" --variable ANDROID_APP_TOKEN="{android-app-token}"
  5. Deploy your app.

  6. View your performance data from the mobile monitoring UI.

Update the plugin

Easily update the New Relic Cordova plugin to the latest released version using the following command:

cordova plugin update

Default Cordova attributes

The Cordova plugin collects the following attributes:




A unique identifier for the monitored app. For example, 35091.


Indicates the technical build number of the binary that crashed. As a developer, you can use this attribute to see exactly which build of your app crashed.


The name of the monitored app. For example, New Relic iOS.


The version number of the monitored app. For example, 2.2.9.


A New Relic unique version number of the monitored app.


The processor architecture of the device such as armv7, arm64.


The Autonomous System Number which the device was associated with when the data was reported.


The telecom owner of the ASN.


The mobile network over which the app transferred data, such as WiFi, Verizon, Sprint, etc.


The type of data being collected. The standard categories are Session, Interaction, and Crash. If you've added custom events via the API, they use the Custom category.


The city where the monitored app is located, such as Portland or Seattle.


The country where the monitored app is located. For example, GB for the United Kingdom. For a list of country codes, see ISO 3166-1 alpha-2.


The exception associated with the crash, if one is present. For example, java.lang.NullPointerException.


The message associated with the crash, if one is present.


The name of the device, such as iPad Air or Galaxy S5.


The category of the device, such as iPod Touch or iPad.


The manufacturer of the device. For example, Motorola or HTC.


The model number of the device. For example, XT1039 or SM-G900F.


The total time, in seconds, for the interaction to render on the device. In addition to render time, this usually includes all external calls associated with the interaction.


If TRUE, this session was from a fresh app install.


The last interaction before a crash event, if one is present. For example, App Launch.


The total amount of memory, in MB, used by the application. Updated every 60 seconds.


The name of the interaction associated with the event. For example, ApplicationsListFragment or NavigationDrawerFragment.


The version number of the agent running on the application. For example, 4.232.0.


The simplified version number of the app's host operating system, such as iOS 7, as compared to iOS 7.0.4.


The name of app's host operating system, for example, iOS or Android.


The exact version number of the app's host operating system, such as iOS 7.0.4, as compared to iOS 7.


The specific region within a country where the monitored app is located. In the United States, regions are states.


The length of time for which the user used the application in seconds. If the session crashes, sessionDuration is not captured (although other events and attributes are still recorded).

For sessions longer than 10 minutes, events in the Interaction and Custom event categories are sent to Insights while the session is ongoing, and therefore do not have sessionDuration attributes. Events recorded near the end of the session will include the duration, as will the Session event category.


A unique identifier for a single user session.


The time, in seconds, since the interaction before a crash event.


The time, in seconds, from the beginning of the mobile session to the time the event occurred. The event can be a built-in event category of Session, Interaction or Crash, as well as any Custom events sent via the agent API.


When an upgrade is detected, specifies the version number of the old version from which the user upgraded. For example, 2.2.8. For the current version number, use the version attribute.


A unique identifier for a specific installation of the app on a particular device, such as B8B0BC30-0235-11E4-9191-0800200C9A66.

Create issueEdit page
Copyright © 2022 New Relic Inc.