Provides all available methods for defining and reporting Analytics from use of your app. More...
#import <Flurry.h>
Inherits NSObject.
Class Methods | |
(void) | + startSession: |
Start a Flurry session for the project denoted by apiKey . More... | |
(void) | + startSession:withOptions: |
Start a Flurry session for the project denoted by apiKey . More... | |
(BOOL) | + activeSessionExists |
Returns true if a session currently exists and is active. More... | |
(NSString *) | + getSessionID |
Returns the session ID of the current active session. More... | |
(void) | + setDelegate: |
Set Flurry delegate for callback on session creation. More... | |
(void) | + pauseBackgroundSession |
Pauses a Flurry session left running in background. More... | |
(void) | + addSessionOrigin:withDeepLink: |
Adds an session origin and deep link attached to each session specified by sessionOriginName and deepLink . More... | |
(void) | + addSessionOrigin: |
Adds an session origin attached to each session specified by sessionOriginName . More... | |
(void) | + sessionProperties: |
Adds a custom parameterized session parameters parameters . More... | |
(void) | + addOrigin:withVersion: |
Adds an SDK origin specified by originName and originVersion . More... | |
(void) | + addOrigin:withVersion:withParameters: |
Adds a custom parameterized origin specified by originName with originVersion and parameters . More... | |
Pre-Session Calls | |
Optional sdk settings that should be called before start session. | |
(void) | + setAppVersion: |
Explicitly specifies the App Version that Flurry will use to group Analytics data. More... | |
(NSString *) | + getFlurryAgentVersion |
Retrieves the Flurry Agent Build Version. More... | |
(void) | + setShowErrorInLogEnabled: |
Displays an exception in the debug log if thrown during a Session. More... | |
(void) | + setDebugLogEnabled: |
Generates debug logs to console. More... | |
(void) | + setLogLevel: |
Generates debug logs to console. More... | |
(void) | + setSessionContinueSeconds: |
Set the timeout for expiring a Flurry session. More... | |
(void) | + setCrashReportingEnabled: |
Enable automatic collection of crash reports. More... | |
Event and Error Logging | |
Methods for reporting custom events and errors during the session. | |
(FlurryEventRecordStatus) | + logEvent: |
Records a custom event specified by eventName . More... | |
(FlurryEventRecordStatus) | + logEvent:withParameters: |
Records a custom parameterized event specified by eventName with parameters . More... | |
(void) | + logError:message:exception: |
Records an app exception. Commonly used to catch unhandled exceptions. More... | |
(void) | + logError:message:error: |
Records an app error. More... | |
(FlurryEventRecordStatus) | + logEvent:timed: |
Records a timed event specified by eventName . More... | |
(FlurryEventRecordStatus) | + logEvent:withParameters:timed: |
Records a custom parameterized timed event specified by eventName with parameters . More... | |
(void) | + endTimedEvent:withParameters: |
Ends a timed event specified by eventName and optionally updates parameters with parameters . More... | |
Page View Methods | |
Count page views. | |
(void) | + logAllPageViews: |
see +(void)logAllPageViewsForTarget:target; for details More... | |
(void) | + logAllPageViewsForTarget: |
Automatically track page views on a UINavigationController or UITabBarController . More... | |
(void) | + stopLogPageViewsForTarget: |
Stops logging page views on previously observed with logAllPageViewsForTarget: UINavigationController or UITabBarController . More... | |
(void) | + logPageView |
Explicitly track a page view during a session. More... | |
User Info | |
Methods to set user information. | |
(void) | + setUserID: |
Assign a unique id for a user in your app. More... | |
(void) | + setAge: |
Set your user's age in years. More... | |
(void) | + setGender: |
Set your user's gender. More... | |
Location Reporting | |
Methods for setting location information. | |
(void) | + setLatitude:longitude:horizontalAccuracy:verticalAccuracy: |
Set the location of the session. More... | |
Session Reporting Calls | |
Optional methods that can be called at any point to control session reporting. | |
(void) | + setSessionReportsOnCloseEnabled: |
Set session to report when app closes. More... | |
(void) | + setSessionReportsOnPauseEnabled: |
Set session to report when app is sent to the background. More... | |
(void) | + setBackgroundSessionEnabled: |
Set session to support background execution. More... | |
(void) | + setEventLoggingEnabled: |
Enable custom event logging. More... | |
(void) | + setPulseEnabled: |
Enables Flurry Pulse. More... | |
(FlurryEventRecordStatus) | + logEvent:syndicationID:parameters: |
Records a syndicated event specified by syndicationEvent . More... | |
Provides all available methods for defining and reporting Analytics from use of your app.
Set of methods that allow developers to capture detailed, aggregate information regarding the use of their app by end users.
+ (BOOL) activeSessionExists |
Returns true if a session currently exists and is active.
+ (void) addOrigin: | (NSString *) | originName | |
withVersion: | (NSString *) | originVersion | |
Adds an SDK origin specified by originName
and originVersion
.
This method allows you to specify origin within your Flurry SDK wrapper. As a general rule you should capture all the origin info related to your wrapper for Flurry SDK after every session start.
originName | Name of the origin. |
originVersion | Version string of the origin wrapper |
+ (void) addOrigin: | (NSString *) | originName | |
withVersion: | (NSString *) | originVersion | |
withParameters: | (NSDictionary *) | parameters | |
Adds a custom parameterized origin specified by originName
with originVersion
and parameters
.
This method overrides #addOrigin to allow you to associate parameters with an origin attribute. Parameters are valuable as they allow you to store characteristics of an origin.
originName | Name of the origin. |
originVersion | Version string of the origin wrapper |
parameters | An immutable copy of map containing Name-Value pairs of parameters. |
+ (void) addSessionOrigin: | (NSString *) | sessionOriginName |
Adds an session origin attached to each session specified by sessionOriginName
.
This method allows you to specify session origin for each session. This is different than addOrigin which is used for third party wrappers after every session start.
sessionOriginName | Name of the origin. |
+ (void) addSessionOrigin: | (NSString *) | sessionOriginName | |
withDeepLink: | (NSString *) | deepLink | |
Adds an session origin and deep link attached to each session specified by sessionOriginName
and deepLink
.
This method allows you to specify session origin and deep link for each session. This is different than addOrigin which is used for third party wrappers after every session start.
sessionOriginName | Name of the origin. |
deepLink | Url of the deep Link. |
+ (void) endTimedEvent: | (NSString *) | eventName | |
withParameters: | (NSDictionary *) | parameters | |
Ends a timed event specified by eventName
and optionally updates parameters with parameters
.
This method ends an existing timed event. If parameters are provided, this will overwrite existing parameters with the same name or create new parameters if the name does not exist in the parameter map set by logEvent:withParameters:timed:.
eventName | Name of the event. For maximum effectiveness, we recommend using a naming scheme that can be easily understood by non-technical people in your business domain. |
parameters | An immutable copy of map containing Name-Value pairs of parameters. |
+ (NSString *) getFlurryAgentVersion |
Retrieves the Flurry Agent Build Version.
This is an optional method that retrieves the Flurry Agent Version the app is running under. It is most often used if reporting an unexpected behavior of the SDK to Flurry Support
+ (NSString*) getSessionID |
Returns the session ID of the current active session.
+ (void) logAllPageViews: |
see +(void)logAllPageViewsForTarget:target; for details
+ (void) logAllPageViewsForTarget: | (id) | target |
Automatically track page views on a UINavigationController
or UITabBarController
.
This method increments the page view count for a session based on traversing a UINavigationController or UITabBarController. The page view count is only a counter for the number of transitions in your app. It does not associate a name with the page count. To associate a name with a count of occurences see logEvent:.
target | The navigation or tab bar controller. |
+ (void) logError: | (NSString *) | errorID | |
message: | (NSString *) | message | |
error: | (NSError *) | error | |
Records an app error.
This method captures an error for reporting to Flurry.
errorID | Name of the error. |
message | The message to associate with the error. |
error | The error object to report. |
+ (void) logError: | (NSString *) | errorID | |
message: | (NSString *) | message | |
exception: | (NSException *) | exception | |
Records an app exception. Commonly used to catch unhandled exceptions.
This method captures an exception for reporting to Flurry. We recommend adding an uncaught exception listener to capture any exceptions that occur during usage that is not anticipated by your app.
errorID | Name of the error. |
message | The message to associate with the error. |
exception | The exception object to report. |
+ (FlurryEventRecordStatus) logEvent: | (NSString *) | eventName |
Records a custom event specified by eventName
.
This method allows you to specify custom events within your app. As a general rule you should capture events related to user navigation within your app, any action around monetization, and other events as they are applicable to tracking progress towards your business goals.
eventName | Name of the event. For maximum effectiveness, we recommend using a naming scheme that can be easily understood by non-technical people in your business domain. |
+ (FlurryEventRecordStatus) logEvent: | (FlurrySyndicationEvent) | syndicationEvent | |
syndicationID: | (NSString *) | syndicationID | |
parameters: | (NSDictionary *) | parameters | |
Records a syndicated event specified by syndicationEvent
.
This method is excusively for use by the Tumblr App, calls from others app will be ignored.
syndicationEvent | syndication event. |
syndicationID | syndication ID that is associated with the event |
parameters | use this to pass in syndication parameters such as kSyndicationiOSDeepLink, kSyndicationAndroidDeepLink, kSyndicationWebLinkDeepLink |
+ (FlurryEventRecordStatus) logEvent: | (NSString *) | eventName | |
timed: | (BOOL) | timed | |
Records a timed event specified by eventName
.
This method overrides #logEvent to allow you to capture the length of an event. This can be extremely valuable to understand the level of engagement with a particular action. For example, you can capture how long a user spends on a level or reading an article.
eventName | Name of the event. For maximum effectiveness, we recommend using a naming scheme that can be easily understood by non-technical people in your business domain. |
timed | Specifies the event will be timed.. |
+ (FlurryEventRecordStatus) logEvent: | (NSString *) | eventName | |
withParameters: | (NSDictionary *) | parameters | |
Records a custom parameterized event specified by eventName
with parameters
.
This method overrides #logEvent to allow you to associate parameters with an event. Parameters are extremely valuable as they allow you to store characteristics of an action. For example, if a user purchased an item it may be helpful to know what level that user was on. By setting this parameter you will be able to view a distribution of levels for the purcahsed event on the Flurrly Dev Portal.
eventName | Name of the event. For maximum effectiveness, we recommend using a naming scheme that can be easily understood by non-technical people in your business domain. |
parameters | An immutable copy of map containing Name-Value pairs of parameters. |
+ (FlurryEventRecordStatus) logEvent: | (NSString *) | eventName | |
withParameters: | (NSDictionary *) | parameters | |
timed: | (BOOL) | timed | |
Records a custom parameterized timed event specified by eventName
with parameters
.
This method overrides #logEvent to allow you to capture the length of an event with parameters. This can be extremely valuable to understand the level of engagement with a particular action and the characteristics associated with that action. For example, you can capture how long a user spends on a level or reading an article. Parameters can be used to capture, for example, the author of an article or if something was purchased while on the level.
eventName | Name of the event. For maximum effectiveness, we recommend using a naming scheme that can be easily understood by non-technical people in your business domain. |
parameters | An immutable copy of map containing Name-Value pairs of parameters. |
timed | Specifies the event will be timed.. |
+ (void) logPageView |
Explicitly track a page view during a session.
This method increments the page view count for a session when invoked. It does not associate a name with the page count. To associate a name with a count of occurences see logEvent:.
+ (void) pauseBackgroundSession |
Pauses a Flurry session left running in background.
This method should be used in case of setBackgroundSessionEnabled: set to YES. It can be called when application finished all background tasks (such as playing music) to pause session.
+ (void) sessionProperties: | (NSDictionary *) | parameters |
Adds a custom parameterized session parameters parameters
.
This method allows you to associate parameters with an session. Parameters are valuable as they allow you to store characteristics of an session.
parameters | An immutable copy of map containing Name-Value pairs of parameters. |
+ (void) setAge: | (int) | age |
Set your user's age in years.
Use this method to capture the age of your user. Only use this method if you collect this information explictly from your user (i.e. - there is no need to set a default value).
age | Reported age of user. |
+ (void) setAppVersion: | (NSString *) | version |
Explicitly specifies the App Version that Flurry will use to group Analytics data.
This is an optional method that overrides the App Version Flurry uses for reporting. Flurry will use the CFBundleVersion in your info.plist file when this method is not invoked.
version | The custom version name. |
+ (void) setBackgroundSessionEnabled: | (BOOL) | setBackgroundSessionEnabled |
Set session to support background execution.
Use this method to enable reporting of errors and events when application is running in backgorund (such applications have UIBackgroundModes in Info.plist). You should call pauseBackgroundSession when appropriate in background mode to pause the session (for example when played song completed in background)
Default value is NO
setBackgroundSessionEnabled | YES to enbale background support and continue log events and errors for running session. |
+ (void) setCrashReportingEnabled: | (BOOL) | value |
Enable automatic collection of crash reports.
This is an optional method that collects crash reports when enabled. The default value is NO
.
value | YES to enable collection of crash reports. |
+ (void) setDebugLogEnabled: | (BOOL) | value |
Generates debug logs to console.
This is an optional method that displays debug information related to the Flurry SDK. display information to the console. The default setting for this method is NO
which sets the log level to FlurryLogLevelCriticalOnly
. When set to YES
the debug log level is set to FlurryLogLevelDebug
value | YES to show debug logs, NO to omit debug logs. |
+ (void) setDelegate: | (id< FlurryDelegate >) | delegate |
+ (void) setEventLoggingEnabled: | (BOOL) | value |
Enable custom event logging.
Use this method to allow the capture of custom events. The default value is YES
.
value | YES to enable event logging, NO to stop custom logging. |
+ (void) setGender: | (NSString *) | gender |
Set your user's gender.
Use this method to capture the gender of your user. Only use this method if you collect this information explictly from your user (i.e. - there is no need to set a default value). Allowable values are "m" or @c @"f"
gender | Reported gender of user. |
+ (void) setLatitude: | (double) | latitude | |
longitude: | (double) | longitude | |
horizontalAccuracy: | (float) | horizontalAccuracy | |
verticalAccuracy: | (float) | verticalAccuracy | |
Set the location of the session.
Use information from the CLLocationManager to specify the location of the session. Flurry does not automatically track this information or include the CLLocation framework.
After starting the location manager, you can set the location with Flurry. You can implement CLLocationManagerDelegate to be aware of when the location is updated. Below is an example of how to use this method, after you have recieved a location update from the locationManager.
latitude | The latitude. |
longitude | The longitude. |
horizontalAccuracy | The radius of uncertainty for the location in meters. |
verticalAccuracy | The accuracy of the altitude value in meters. |
+ (void) setLogLevel: | (FlurryLogLevel) | value |
Generates debug logs to console.
This is an optional method that displays debug information related to the Flurry SDK. display information to the console. The default setting for this method is FlurryLogLevelCritycalOnly
.
value | Log level |
+ (void) setPulseEnabled: | (BOOL) | value |
Enables Flurry Pulse.
value | YES to enable event logging, NO to stop custom logging. |
+ (void) setSessionContinueSeconds: | (int) | seconds |
Set the timeout for expiring a Flurry session.
This is an optional method that sets the time the app may be in the background before starting a new session upon resume. The default value for the session timeout is 10 seconds in the background.
seconds | The time in seconds to set the session timeout to. |
+ (void) setSessionReportsOnCloseEnabled: | (BOOL) | sendSessionReportsOnClose |
Set session to report when app closes.
Use this method report session data when the app is closed. The default value is YES
.
sendSessionReportsOnClose | YES to send on close, NO to omit reporting on close. |
+ (void) setSessionReportsOnPauseEnabled: | (BOOL) | setSessionReportsOnPauseEnabled |
Set session to report when app is sent to the background.
Use this method report session data when the app is paused. The default value is YES
.
setSessionReportsOnPauseEnabled | YES to send on pause, NO to omit reporting on pause. |
+ (void) setShowErrorInLogEnabled: | (BOOL) | value |
Displays an exception in the debug log if thrown during a Session.
This is an optional method that augments the debug logs with exceptions that occur during the session. You must both capture exceptions to Flurry and set debug logging to enabled for this method to display information to the console. The default setting for this method is NO
.
value | YES to show errors in debug logs, NO to omit errors in debug logs. |
+ (void) setUserID: | (NSString *) | userID |
Assign a unique id for a user in your app.
userID | The app id for a user. |
+ (void) startSession: | (NSString *) | apiKey |
Start a Flurry session for the project denoted by apiKey
.
This method serves as the entry point to Flurry Analytics collection. It must be called in the scope of applicationDidFinishLaunching
. The session will continue for the period the app is in the foreground until your app is backgrounded for the time specified in setSessionContinueSeconds:. If the app is resumed in that period the session will continue, otherwise a new session will begin.
Crash reporting will not be enabled. See setCrashReportingEnabled: for more information.
apiKey | The API key for this project. |
+ (void) startSession: | (NSString *) | apiKey | |
withOptions: | (id) | options | |
Start a Flurry session for the project denoted by apiKey
.
This method serves as the entry point to Flurry Analytics collection. It must be called in the scope of applicationDidFinishLaunching
passing in the launchOptions param. The session will continue for the period the app is in the foreground until your app is backgrounded for the time specified in setSessionContinueSeconds:. If the app is resumed in that period the session will continue, otherwise a new session will begin.
apiKey | The API key for this project. |
options | passed launchOptions from the applicatin's didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
+ (void) stopLogPageViewsForTarget: | (id) | target |
Stops logging page views on previously observed with logAllPageViewsForTarget: UINavigationController
or UITabBarController
.
Call this method before instance of UINavigationController
or UITabBarController
observed with logAllPageViewsForTarget: is released.
target | The navigation or tab bar controller. |