PFAnalytics

@interface PFAnalytics : NSObject

PFAnalytics provides an interface to Parse’s logging and analytics backend.

Methods will return immediately and cache the request (+ timestamp) to be handled eventually. That is, the request will be sent immediately if possible or the next time a network connection is available.

  • Tracks this application being launched. 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.

    Pass in nil to track a standard application opened event.

    Declaration

    Objective-C

    + (id)trackAppOpenedWithLaunchOptions:(nullable NSDictionary *)launchOptions;

    Parameters

    launchOptions

    The NSDictionary indicating the reason the application was launched, if any. This value can be found as a parameter to various UIApplicationDelegate methods, and can be empty or nil.

    Return Value

    Returns the task encapsulating the work being done.

  • Tracks this application being launched. 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.

    Pass in nil to track a standard application opened event.

    Declaration

    Objective-C

    + (void)trackAppOpenedWithLaunchOptionsInBackground:
                (nullable NSDictionary *)
                    launchOptions block:(nullable PFBooleanResultBlock)block;

    Parameters

    launchOptions

    The dictionary indicating the reason the application was launched, if any. This value can be found as a parameter to various UIApplicationDelegate methods, and can be empty or nil.

    block

    The block to execute on server response. It should have the following argument signature: ^(BOOL succeeded, NSError *error)

  • Tracks this application being launched. 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.

    Declaration

    Objective-C

    + (id)trackAppOpenedWithRemoteNotificationPayload:
            (nullable NSDictionary *)userInfo;

    Parameters

    userInfo

    The Remote Notification payload, if any. This value can be found either under UIApplicationLaunchOptionsRemoteNotificationKey on launchOptions, or as a parameter to application:didReceiveRemoteNotification:. This can be empty or nil.

    Return Value

    Returns the task encapsulating the work being done.

  • Tracks this application being launched. 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.

    Declaration

    Objective-C

    + (void)trackAppOpenedWithRemoteNotificationPayloadInBackground:
                (nullable NSDictionary *)userInfo block:
                    (nullable PFBooleanResultBlock)block;

    Parameters

    userInfo

    The Remote Notification payload, if any. This value can be found either under UIApplicationLaunchOptionsRemoteNotificationKey on launchOptions, or as a parameter to application:didReceiveRemoteNotification:. This can be empty or nil.

    block

    The block to execute on server response. It should have the following argument signature: ^(BOOL succeeded, NSError *error)

  • Tracks the occurrence of a custom event.

    Parse will store a data point at the time of invocation with the given event name.

    Declaration

    Objective-C

    + (id)trackEvent:(nonnull NSString *)name;

    Parameters

    name

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

    Return Value

    Returns the task encapsulating the work being done.

  • Tracks the occurrence of a custom event. Parse will store a data point at the time of invocation with the given event name. The event will be sent at some unspecified time in the future, even if Parse is currently inaccessible.

    Declaration

    Objective-C

    + (void)trackEventInBackground:(nonnull NSString *)name
                             block:(nullable PFBooleanResultBlock)block;

    Parameters

    name

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

    block

    The block to execute on server response. It should have the following argument signature: ^(BOOL succeeded, NSError *error)

  • 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. Keys and values should be NSStrings, and will throw otherwise.

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

    NSDictionary *dimensions = @{ @gender: @m, @source: @web, @dayType: @weekend }; [PFAnalytics trackEvent:@signup dimensions:dimensions];

    Warning

    There is a default limit of 8 dimensions per event tracked.

    Declaration

    Objective-C

    + (id)trackEvent:(nonnull NSString *)name
          dimensions:(nullable NSDictionary<NSString *, NSString *> *)dimensions;

    Parameters

    name

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

    dimensions

    The NSDictionary of information by which to segment this event.

    Return Value

    Returns the task encapsulating the work being done.

  • 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. The event will be sent at some unspecified time in the future, even if Parse is currently inaccessible.

    @discussionDimensions will allow segmentation of the occurrences of this custom event. Keys and values should be NSStrings, and will throw otherwise.

    To track a user signup along with additional metadata, consider the following: NSDictionary *dimensions = @{ @gender: @m, @source: @web, @dayType: @weekend }; [PFAnalytics trackEvent:@signup dimensions:dimensions];

    There is a default limit of 8 dimensions per event tracked.

    Declaration

    Objective-C

    + (void)trackEventInBackground:(nonnull NSString *)name
                        dimensions:(nullable NSDictionary<NSString *, NSString *> *)
                                       dimensions
                             block:(nullable PFBooleanResultBlock)block;

    Parameters

    name

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

    dimensions

    The NSDictionary of information by which to segment this event.

    block

    The block to execute on server response. It should have the following argument signature: ^(BOOL succeeded, NSError *error)