Release Notes: (1.7.1)
  • Upgraded to Flurry iOS SDK 6.3.0.
  • Upgraded to Flurry Android SDK 5.5.0.

Integration Guide - Flurry Analytics Plugin

Platforms: Android & iOS
Plugin version: 1.7.1
Flurry iOS SDK version: 6.0.0
Flurry Android SDK version: 5.1.0
Supported Unity3d version: 3.5.x, 4.x, 5.x

Generally you don't have to dive into the documentation from Flurry, simply follow a few steps below to get the plugin integrated in your App in minutes:

[1] Import the FlurryAnalytics[Android|IOS|Universal].unitypackage file to your unity project;

[2] Follow the instructions below to configure the plugin.

· >>> For Android platform, click on the menu item of Unity top menu bar: NeatPlug -> FlurryAnalytics -> Patch Android Configuration. This is for generating a valid AndroidManifest.xml or patching the existing file with FlurryAnalytics support.


· >>> For iOS platform, click on the menu item of Unity top menu bar: NeatPlug -> FlurryAnalytics -> Patch iOS Configuration. This is for automatically adding iOS SDK frameworks, libraries or patching the Info.plist file (if needed) as long as the Xcode project is generated by Unity.

[3] Find FlurryAnalyticsAgent Prefab in Assets/Standard Assets/NeatPlug/Analytics/FlurryAnalytics/Prefabs/, open the first scene of your game, drag & drop the prefab into the scene.

[4] Okay, the integration is done here. Now set up Flurry by filling in a few properties of the FlurryAnalyticsAgent gameObject which you just dropped in the Hierarchy window. To do this, simply select that gameObject, and look at its properties in the Inspector window, you need to fill in:

   · Api Key [Android|IOS] - The Api Key of your App (You can get it from Flurry dev site).

   · Log Use Https - Check this if you want to enable secure data transmission.

   · Enable Crash Reporting - Check this if you want to log the App crash on Flurry.

   · Enable Debugging - Check this if you want to see verbose debug info in the log.

Now it's the time to do logging!

[5] Call below functions to log an event, error or pageview:

   · FlurryAnalytics.Instance().Init(string apiKey, ...) - Required if you don't apply "Api Key" property value for FlurryAnalyticsAgent.

   · FlurryAnalytics.Instance().LogEvent(...) - Log an event.

   · FlurryAnalytics.Instance().LogError(...) - Log an app error.

   · FlurryAnalytics.Instance().LogPageview() - Log a pageview.

  There are other useful public methods that FlurryAnalytics provides, to use them, call FlurryAnalytics.Instance().methodName().
Show All   
public void Init(string apiKey, bool logUseHttps, bool enableCrashReporting, bool enableDebugging)
/**
 * Initialization.
 * 
 * @param apiKey
 *            string - Your App API key.	
 * 
 * @param logUseHttps
 *            bool - True for using HTTPS for log data transferring, false for using HTTP.
 * 
 * @param enableCrashReporting
 *            bool - True for enabling App crash reporting, false for not.
 * 
 * @param enableDebugging
 *            bool - True for printing debug info in the log, false for not.
 * 
 */
public void Init(string apiKey, bool logUseHttps, bool enableCrashReporting, bool enableDebugging)
public void LogEvent(string eventId, string[]keyVals = null, bool timed = false)
/**
 * Log an event.
 * 
 * Use logEvent to count the number of times certain events happen during a session 
 * of your application. This can be useful for measuring how often users perform 
 * various actions.
 * 
 * @param eventId
 *          string - The eventId for identifying the event.	
 * 
 * @param keyVals
 *          string[] - Additional info in Key-Value pairs, for instance: 
 *                     new string[]{"key1:val1","key2:val2"}
 * 
 * @param timed
 *          bool - Whether the event is timed.
 *                 NOTE: If you log a timed event, you will need to
 *                 call "EndTimedEvent()" to end the timed event when
 *                 it ends.
 */
public void LogEvent(string eventId, string[] keyVals = null, bool timed = false)
public void LogEvent(string eventId, Dictionary<string, string> parameters = null, bool timed = false)
/**
 * Log an event.
 * 
 * Use logEvent to count the number of times certain events happen during a session 
 * of your application. This can be useful for measuring how often users perform 
 * various actions.
 * 
 * @param eventId
 *          string - The eventId for identifying the event.	
 * 
 * @param parameters
 *          Dictionary<string, string> - Additional info in a dictionary.
 * 
 * @param timed
 *          bool - Whether the event is timed.
 *                 NOTE: If you log a timed event, you will need to
 *                 call "EndTimedEvent()" to end the timed event when
 *                 it ends.
 */
public void LogEvent(string eventId, Dictionary<string, string> parameters = null, bool timed = false)
public void LogTimedEvent(string eventId, string[] keyVals = null)
/**
 * Log a timed event.
 * 
 * NOTE: you will need to call "EndTimedEvent()" to end the timed event when it ends.
 * 
 * Use logEvent to count the number of times certain events happen during a session 
 * of your application. This can be useful for measuring how often users perform 
 * various actions.	
 * 
 * @param eventId
 *          string - The eventId for identifying the event.	
 * 
 * @param keyVals
 *          string[] - Additional info in Key-Value pairs, for instance: 
 *                     new string[]{"key1:val1","key2:val2"}
 * 	
 */
public void LogTimedEvent(string eventId, string[] keyVals = null)
public void LogTimedEvent(string eventId, Dictionary<string, string> parameters = null)
/**
 * Log a timed event.
 * 
 * NOTE: you will need to call "EndTimedEvent()" to end the timed event when it ends.
 * 
 * Use logEvent to count the number of times certain events happen during a session 
 * of your application. This can be useful for measuring how often users perform 
 * various actions.	 
 * 
 * @param eventId
 *          string - The eventId for identifying the event.	
 * 
 * @param parameters
 *          Dictionary - Additional info in dictionary.
 * 	
 */
public void LogTimedEvent(string eventId, Dictionary<string, string> parameters = null)
public void EndTimedEvent(string eventId, string[] keyVals = null)
/**
 * End a timed event with additional information.
 * 
 * @param eventId
 *          string - The eventId for identifying the event.
 * 
 * @param keyVals
 *          string[] - Additional info in Key-Value pairs, for instance: 
 *                     new string[]{"key1:val1","key2:val2"}
 * 
 */
public void EndTimedEvent(string eventId, string[] keyVals = null)
public void EndTimedEvent(string eventId, Dictionary<string, string> parameters = null)
/**
 * End a timed event with additional information.
 * 
 * @param eventId
 *          string - The eventId for identifying the event.
 * 
 * @param parameters
 *          Dictionary - Additional info in a dictionary.
 * 
 */
public void EndTimedEvent(string eventId, Dictionary<string, string> parameters = null)
public void LogError(string errorId, string message, string errorClass)
/**
 * Log an application error.
 * 
 * Use this to log exceptions and/or errors that occur in your app. 	
 * 
 * @param errorId
 *          string - The errorId for identifying the error.                   
 * 
 * @param message
 *          string - The error message.
 * 
 * @param errorClass
 *          string - The error class in which the error occurred.
 */
public void LogError(string errorId, string message, string errorClass)
public void LogPageview()
/**
 * Log a page view.
 * 
 * Use this to report page view count. You should call this method
 * whenever a new page is shown to the user to increment the total count. 
 * Page view is tracked separately from events.	
 */
public void LogPageview()
public void SetUserId(string userId)
/**
 * Set the user ID.
 * 
 * Use this to log the user's assigned ID or username in your system.
 * 
 * @param userId
 *          string - The userId assigned by your system.                   
 * 	
 */
public void SetUserId(string userId)
public void SetUserAge(int userAge)
/**
 * Set the user's age.
 * 
 * Use this to log the user's age after identifying the user.
 * 
 * @param userAge
 *          int - The user's age obtained from your app.                   
 * 	
 */
public void SetUserAge(int userAge)
public void SetUserGender(bool isFemale)
/**
 * Set the user's gender.
 * 
 * Use this to log the user's gender after identifying the user.
 * 
 * @param isFemale
 *          bool - true for female, false for male.                   
 * 	
 */
public void SetUserGender(bool isFemale)
public void SetUserLocation(double latitude, double longitude)
/**
 * Set the user's geo location.
 * 
 * Use this to log the user's location. You may need extra plugin for
 * getting the user's geo location, it is recommended that you use
 * the NativeToolbox plugin from http://www.neatplug.com, it's under
 * the "Native" section. 
 * The function can be called periodically to get the plugin updated with
 * the changed user location.	 
 * 
 * @param latitude
 *          double - The latitude of the location.
 *
 * @param longitude
 *          double - The longitude of the location.
 * 	
 */
public void SetUserLocation(double latitude, double longitude)
public void SetSessionTimeout(int seconds)
/**
 * Set the timeout for expiring a Flurry session.(In seconds)
 * 
 * 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.
 * 
 * @param seconds
 *          int - The timeout in seconds.                   
 * 	
 */
public void SetSessionTimeout(int seconds)

[6] Build your App now.

[7] Test and verify if events can be logged on Flurry's servers as expected, generally it takes several hours for reports to appear in your Flurry dev account, you need to be a little patient. If you encounter any exceptions, it would be helpful for you to address issues if you take a look at the logcat output (Android) or xcode debug console (iOS) to find the debug / error / warning messages.

[EOF] Should you have any questions or encounter any problems while integrating the plugin, please do not hesitate to shoot us an email at support@neatplug.com, we will be more than happy to help you. Thanks for choosing NeatPlug solutions!