Real User Monitoring for mobile

Setup instructions

1. Install the Raygun4Android provider

Ensure Maven Central is present in your project's build.gradle:

allprojects {
    repositories {

Then add the following two compile statements to the dependencies section in your module's build.gradle:

dependencies {
    // Existing dependencies may go here
    compile ''
    compile ''

Then sync your project.

Alternatively, the Raygun4Android Real User Monitoring provider can be manually downloaded here.

2. Enable Real User Monitoring in your app

In AndroidManifest.xml, add these beneath the manifest element:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Then add the following within the application element, making sure to include your Raygun app API key. Your app API key is displayed when you create a new application in your Raygun account, or when you enable Real User Monitoring for an existing app, or can be viewed in the "Application settings".

<service   android:name=""
<meta-data android:name=""
           android:value="YOUR_APP_API_KEY" />

Add the following imports to the starting activity of your application:


Finally, enable Raygun Real User Monitoring by adding the following code to the onCreate method of your starting activity:


If you wish to use Real User Monitoring without network performance logging, use the code below.

boolean withNetworkLogging = false;
RaygunClient.attachPulse(this, withNetworkLogging);

3. Provide a user identifier

By default, each user will be identified with a unique guid. If possible, we highly recommend providing your own unique identifiers for your users which can be done as follows. The first string parameter can be any unique user id you want - email address is just a recommended example.

RaygunClient.setUser(new RaygunUserInfo(email, firstName, fullName, email, null, false));


Real User Monitoring messages will be sent to Raygun as soon as the app starts up. So once you've set up Real User Monitoring in your app, run it up and go to your Real User Monitoring dashboard to see the data it collects. Of course Real User Monitoring is most valuable once your app is out there in the store.


Real User Monitoring will automatically record information about views when attached. You can filter out the reporting of view information by view name.

RaygunClient.ignoreViews(new String[]{ "MainActivity" });

Network calls

Once Real User Monitoring is enabled, Raygun4Android will automatically log the performance of network calls made with the following methods.


You can also manually log the timings of network calls using the following Raygun4Android API.

RaygunClient.sendPulseTimingEvent(RaygunPulseEventType.NETWORK_CALL, "GET", 1234);

The name string can be whatever works best for you - the HTTP method and url is a recommended example. The duration is the milliseconds that you've measured the network call to take.

Details about the network calls that you log can be found in the Performance tab of your Real User Monitoring for mobile dashboard.

Filtering network calls

If you don’t wish the performance of certain network requests to be logged, you can filter them out by URL.

RaygunClient.ignoreURLs(new String[]{ "" });

Documentation missing?

If we don't have documentation about your desired topic, send us a message and we'll create it for you.