Tracking Mobile/iPhone/Android Sites and Apps

KISSmetrics can track your mobile site, mobile app, or iOS/Android app. To record events within the mobile site or app, you have two options:

1. Use Ruby/PHP/Python API on backend (recommended)

If possible, we recommend that you record mobile app events when they trigger a corresponding event on your backend servers (Ruby/PHP/Python). Then you can record the server-side event using one of our available server APIs.

Mobile Version of Sites

If your mobile site is just a mobile version of your site(i.e. m.yourdomain.com), you can separate mobile traffic by placing an API command just below the regular KISSmetrics script to set a property of the mobile site to be something like “SiteName” = “mobile”.

Example:

_kmq.push(['set', {'SiteName' : mobile}]);

Mobile Apps

The primary benefit of using the backend server API is that it excludes an additional library from affecting user experience or taking up unnecessary memory on your app. This allow allows you to record all data coming in through the backend at the USER level.

Example:

Data is sent when someone initializes the app. KISSmetrics can capture and record key events as they come in such as:

Use KISSmetrics’ APIs (Ruby/PHP/Python) to record these events seamlessly as they come in so that you can visualize the data you’re already getting. You’re cataloguing and organizing data with KISSmetrics by putting event triggers as data flows in from your customers.

When a user launches the app, you can include an event trigger on your backend (Ruby Example):

KM.identify(grab_user_identification_data_from_db);
KM.record('Launched App', {'Version' => grab_app_version});

Once you have a script for grab_app_version and grab_user_identification_data_from_db it will then look like this for every user launching your app:

KM.identify('user@gmail.com');
KM.record('Launched App', {'Version' => 2.3});

So now when a user does something on your app, you can now record key events for every feature available as it comes into your backend:

KM.record('Used Core Feature 1');
KM.record('Changed Settings');

In addition, you can always set custom properties to users at any time without recording an event. Let’s say you want to know what the first thing a user does after they launch your app.

So you’ve identified them and recorded that they launched the app:

KM.identify(grab_user_identification_data_from_db);
KM.record('Launched App', {'Version' => grab_app_version});

Now you want to find out what they do next.

Write a script to trigger a KISSmetrics API command on the FIRST action after launching the app. It could look like this (please excuse the pseudo-code):

KM.record('Used Core Feature 1');
if action == first feature after launching {
  KM.set({ :Entry Event => replace_with_your_feature_name }) ; }
else {  do nothing  }

The idea here is that you can designate which feature of your app is the “first feature” or “entry event” for users when they launch your app. Later, you can go into your reports and sort users by their first entry event or most recent entry event.

In addition, you can use KISSmetrics server-side API’s to track performance of automated systems such as how many times errors and bugs are being reported/logged.

2. iOS Library

As of this writing, we know only of a community-supported 3rd party library. Please refer to coffeeshopped.com for more details. Though this library is functional, it is not an official library, so we do not test or provide support for it. Please use at your own discretion.

We are currently developing an official iOS library, so please stay tuned.

We currently do not have (or know of) an Android library.


Filed under How To's, Examples, and Best Practices

Search


Learn more about KISSmetrics

Get started now