com.parse
Class ParseAnalytics

Object
  extended by com.parse.ParseAnalytics

public class ParseAnalytics
extends Object

The ParseAnalytics class provides an interface to Parse's logging and analytics backend. Methods will return immediately and cache requests (+ timestamps) to be handled "eventually." That is, the request will be sent immediately if possible or the next time a network connection is available otherwise.


Constructor Summary
ParseAnalytics()
           
 
Method Summary
static void trackAppOpened(Intent intent)
          Tracks this application being launched (and if this happened as the result of the user opening a push notification, this method sends along information to correlate this open with that push).
static void trackEvent(String name)
          Tracks the occurrence of a custom event.
static void trackEvent(String name, Map<String,String> dimensions)
          Tracks the occurrence of a custom event with additional dimensions.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseAnalytics

public ParseAnalytics()
Method Detail

trackAppOpened

public static void trackAppOpened(Intent intent)
Tracks this application being launched (and if this happened as the result of the user opening a push notification, this method sends along information to correlate this open with that push).

Parameters:
intent - The Intent that started an Activity, if any. Can be null.

trackEvent

public static void trackEvent(String name)
Tracks the occurrence of a custom event. Parse will store a data point at the time of invocation with the given event name.

Parameters:
name - The name of the custom event to report to Parse as having happened.

trackEvent

public static void trackEvent(String name,
                              Map<String,String> dimensions)
Tracks the occurrence of a custom event with additional dimensions. Parse will store a data point at the time of invocation with the given event name. Dimensions will allow segmentation of the occurrences of this custom event.

To track a user signup along with additional metadata, consider the following:

 Map dimensions = new HashMap();
 dimensions.put("gender", "m");
 dimensions.put("source", "web");
 dimensions.put("dayType", "weekend");
 ParseAnalytics.trackEvent("signup", dimensions);
 
There is a default limit of 4 dimensions per event tracked.

Parameters:
name - The name of the custom event to report to Parse as having happened.
dimensions - The dictionary of information by which to segment this event.