Advanced Features for Flurry Analytics with Android

Flurry offers a number of advanced features for Android developers that enable you to gain even greater insight into your users.

Track geographic location

NOTE: As of Flurry SDK 14.0.0:

If your app has location permissions, such as

Flurry will track where your app is being used. Flurry uses cached value (to avoid excessive battery usage) when location reporting is enabled. Without ACCESS_FINE_LOCATION permission, Flurry will use the IP address of the user’s device and report this information at the country level.

To disable detailed location reporting even when your app has permission,

Track user ID and demographics

Use this to log the user’s assigned ID or username in your system. This should be called before init, if possible.

Important

Warning: It is a violation of our terms of service to track personally identifiable information such as a device ID (e.g. Android ID) using this method. If you have a user login that you wish to send to Flurry using this method, you must anonymize the data using a hashing function such as MD5 or SHA256 prior to calling this method.

Use this to log the user’s age. Valid inputs are between 1 and 109. This should be called before init, if possible.

Use this to log the user’s gender. Valid inputs are Constants.MALE or Constants.FEMALE. This should be called before init, if possible.

Track errors

Use onError to report errors that your app catches. Flurry will report the first 10 errors to occur in each session.

Use onError to report app errors. Flurry will report the first 10 errors to occur in each session.

The FlurryAgent will also notify you of uncaught exceptions if you added this parameter to the FlurryAgent.Builder. It is used to allow/disallow Flurry SDK to report uncaught exceptions. The feature is enabled by default, and if you would like to enable it this behavior, set it through the FlurryAgent.Builder.

Additional features

The following are additional features provided in the Flurry SDK

FlurryAgent Methods

Description

FlurryAgent.getReleaseVersion()

Returns a string containing current Flurry SDK release version.

FlurryAgent.setVersionName(String versionName)

Sets the version name of the app. This name will appear in the http://y.flurry.com as a filtering option by version. This should be called before init.

FlurryAgent.getAgentVersion()

Gets the version of the Flurry SDK.

FlurryAgent.isSessionActive()

Returns true if Flurry session is active and false otherwise.

FlurryAgent.getSessionId()

Returns the session ID.

FlurryAgent.addOrigin(String originName, String originVersion, Map<String, String> originParameters)

Use addOrigin to if you are wrapping Flurry SDK within another SDK or plugin to mark the origin attribution. The event is identified by the originName, originVersion and originParameters. OriginParameters can be passed in as a Map<String, String> where the key is the parameter name, and the value is the value. This should be called before init.

In addition, note the attributes that you can set through the FlurryAgent.Builder method

FlurryAgent.Builder attributes

Description

FlurryAgent.Builder       withCaptureUncaughtExceptions(boolean captureExceptions)

True to enable or false to disable the ability to catch all uncaught exceptions and have them reported back to Flurry.

FlurryAgent.Builder       withConsent(Consent flurryConsent)

Set Flurry Consent.

FlurryAgent.Builder       withContinueSessionMillis(long sessionMillis)

Set the timeout for expiring a Flurry session.

FlurryAgent.Builder       withDataSalesOptOut(boolean isOptOut)

True to opt-out data sale or false to opt-in data sale.

FlurryAgent.Builder       withIncludeBackgroundSessionsInMetrics(boolean includeBackgroundSessionsInMetrics)

True if this session should be added to total sessions/DAUs when applicationstate is inactive or background.

FlurryAgent.Builder       withListener(FlurryAgentListener listener)

Sets the listener.

FlurryAgent.Builder       withLogEnabled(boolean enableLog)

True to enable or false to disable the internal logging for the Flurry SDK.

FlurryAgent.Builder       withLogLevel(int logLevel)

Set the log level of the internal Flurry SDK logging.

FlurryAgent.Builder       withModule(FlurryModule module)

To register Flurry add-on modules, create each module and pass it in to this builder item

FlurryAgent.Builder       withPerformanceMetrics(int performanceMetrics)

Set flags for performance metrics.

FlurryAgent.Builder       withSessionForceStart(boolean isSessionForceStart)

Force a session to be started after Flurry initialization. Set to true if Flurry is Initialized after Application onCreate() method.

FlurryAgent.Builder       withwithSslPinningEnabled(boolean sslPinningEnabled)

True to enable or false to disable SSL Pinning for Flurry Analytics connection.