Flurry Analytics SDK Integration steps and features introduction
1.Flurry Analytics SDK Website:
Http://www.flurry.com/flurry-analytics.html
2. Integration steps
1) Registered users
Http://www.flurry.com/signup.html
2) Add app after login
(1) To add an application is to choose the device and platform for the application, this article takes the iOS series as an example.
(2) After selecting the platform, fill in the application information to create the app, the iphone is selected here
(3) Once the app is created, you can get the API KEY for the app, which is used when using the Flurry SDK method.
(4) Unzip after downloading the SDK
The flurryanalytics-readmev4.0.6.pdf is the documentation for the integration of the data Analysis SDK, of course, in English.
3) Introduction to Flurry data Analysis SDK
Flurry Data Analysis agents can assist you by looking at Flurry's data analysis system to track the behavior and usage habits of users as they use your application on their devices. This analysis agent is designed to be as simple as possible, and a basic installation can be done in 5 minutes.
The current SDK version (4.0.6) can only be used in Xcode4.5 or above, and if you need an SDK for older versions of Xcode, you may be able to send an email to [email protected] .
There is also an additional folder that is placed on flurry ads. This is an optional dependent component that can be used as an alternative source of revenue for your application. If you prefer to use flurry Ads, please read the library's instructions for use in the SDK package flurryappspot-ios-readmev4.0.6.pdf.
The Flurry agent does not collect GPS location information by default, so corelocation.framework is not required. But developers can use their own Cclocationmanager to set GPS location information in flurry (see optional feature description for more information)
4) Add the Flurry.h and libflurry.a in the Flurry folder to the project you want to integrate.
(1) In the Finder, drag the flurry folder into your project folder. (Note: If you are upgrading your flurry IOS SDK, make sure that the dependent library files for the flurry in your project folder are deleted before you do this)
(2) Add flurry to your project and select "Create groups for any added folders", tick the target you want to integrate.
(3) Add Systemconfiguration.framework to your app. This is the framwork required to efficiently manage the reachability of network operations.
(4) in the deletegate you use for the program, import the Flurry and add the Applicationdidfinishlaunching method to the [Flurry
startsession:@ "Your_api_key"];
The specific code is:
#import "Flurry.h"
-(void) applicationdidfinishlaunching: (uiapplication *) Application {
[Flurry startsession:@ "Your_api_key"];
Your code
}
In this, the required code to get the most basic metadata has been integrated.
5) optional/Advanced Features
You can use this method to get additional data.
(1)[Flurry logevent:@ "Event_Name"];
Use LogEvent to collect the exact number of occurrences of an event in one session of your application. For example, it is useful to measure the frequency of some of the user's behavior. Your application is limited to a maximum of 300 different event IDs (up to 255 characters long).
(2)[Flurry logevent:@ "Event_Name" withparameters:your_nsdictionary];
Use this version of the LogEvent method to collect the exact number of occurrences of an event in a session of your application, and you can pass dynamic parameters along with the event. The arguments to an event can be passed as a Nsdictionary object, but the Nsdictionary object's key and value must be NSString objects. For example, you can record the number of times a user uses your input box tool, and you can record the search terms entered by the user. Your application is currently limited to a maximum of 100 different event IDs (up to 255 characters). Each event supports a maximum of 10 event arguments.
An example of using Nsdictonary under this method:
Nsdictionary *dictionary =
[Nsdictionary dictionarywithobjectsandkeys:@ "Your dynamic parameter value", @ "your dynamic parameter name", Nil];
(3)[Flurry logevent:@ "Event_Name" timed:yes];
Use this version of LogEvent to start timing an event.
(4)[Flurry logevent:@ "Event_Name" Withparameters:your_nsdictionary Timed:yes];
Use this version of LogEvent to start timing an event and pass parameters.
(5)[Flurry endtimedevent:@ "Event_Name" withparameters:your_nsdictionary];
use Endtimedevent to end an event's timing when the application exits, or to automatically end the timing when the app exits. When the end of a timed event, a new event parameter of the Nsdictionery object can be used to update the event arguments. If you want to keep the event arguments, you can pass a nil for the Nsdictionary object of the event argument.
(6)[Flurry Logallpageviews:navigationcontroller];
To enable the flurry agent to automatically detect and record page views, you can pass a uinavigationcontroller or Uitabbarcontroller to Countpageviews. The flurry agent creates a delegate on your object to track user interaction. Each detected user interaction is recorded as a page view. Each instance needs to be passed to the flurry agent only once. However, you can pass multiple Uinavigationcontroller or Uitabbarcontroller instances to the flurry agent.
(7)[Flurry Logpageview];
In the absence of Uinavigationcontroller or Uitabbarcontroller, you can manually track user interactions. You can use the Logpageview method to record page views in every place where you want to manually record user interaction.
(8) Tracking application errors
[Flurry logerror:@ "Error_name" message:@ "Error_message" exception:e];
Use the code above to record exceptions or errors that occur in your application. Flurry will report the top 10 errors in each application session.
(9) Track player stats
[Flurry setuserid:@ "user_id"];
Use this method to record a user ID or user name that has been identified after the user is recognized.
[Flurry setage:21];
using this method to record the user's age after identifying the user, the value of the parameter should be greater than 0;
[Flurry setgender:@ "M"];
Using this method to record the user's gender after identifying the user, the value of the parameter should be m (male) or F (female).
(10) Tracking User Location
Cllocationmanager *locationmanager = [[Cllocationmanager alloc] init];
[Locationmanager startupdatinglocation];
Cllocation *location = locationmanager.location;
[Flurry SetLatitude:location.coordinate.latitude
Longitude:location.coordinate.longitude
HorizontalAccuracy:location.horizontalAccuracy
VerticalAccuracy:location.verticalAccuracy];
The above method allows you to set the user's current GPS location. Flurry will only retain the last location information. If your application cannot use the location service in a meaningful way, using cllocationmanager may cause Apple to reject your application submission.
(11) Control Data Report
[Flurry setsessionreportsoncloseenabled: (BOOL) sendsessionreportsonclose];
This option is turned on by default, and if this option is enabled, flurry will attempt to send session data when the application exits gracefully, as if the program should start, which will increase the speed of your application's profiling data, but may delay the end time of your application due to network latency.
[Flurry setsessionreportsonpauseenabled: (BOOL) sendsessionreportsonpause];
This option is turned off by default, and if this option is enabled, flurry will attempt to send session data when the application is paused, as if the program should start, which will increase the speed of your application profiling data, but may delay your application's pause processing due to network latency.
[Flurry setsecuretransportenabled: (BOOL) securetransport];
This option is turned off by default, and if this option is enabled, flurry will attempt to send session data over SSL when the application is paused, as if the program had started. However, due to the increased network latency from the security handshake and encryption process, your application's pause processing may be delayed.
6) Recommended Specifications
We recommend that you add an uncaught exception listener to your application (if you haven't added it yet) and use Logerror to log any application crashes.
Adding a listener for an uncaught exception is simple, and you just need to create a method as shown in the following code.
void Uncaughtexceptionhandler (NSException *exception)
{
[Flurry logerror:@ "uncaught" message:@ "crash!" exception:exception];
}
Then you need to register this method as an uncaught exception listener using the code shown below:
-(void) applicationdidfinishlaunching: (uiapplication *) Application {
Nssetuncaughtexceptionhandler (&uncaughtexceptionhandler);
[Flurry startsession:@ "Your_api_key"];
....
}
Note that you can randomly name the names of the methods and error messages that you want to record with the wrong nouns and event fields.
5.FAQ
1) How much of the app size will be added using the Flurry Analytics SDK?
Adding the Flurry Analytics SDK in general will increase the final app size by 150KB.
2) When does the flurry agent send the data?
By default, the flurry agent sends the metric data to be stored to the flurry server when the application starts, resumes, and terminates. If you want to override the original proxy behavior, you can turn off sending data when the application terminates by calling the following code before you call startsession.
[Flurry Setsessionreportsoncloseenabled:no];
By default, when an application is paused, the metric data does not occur, and you can send the data on pause with the following code, along with Startsession.
[Flurry Setsessionreportsonpauseenabled:yes];
3) How much data does the flurry agent send in each session?
The flurry agent sends all the data in a compact binary. The total amount of data may be different, but typically the data transferred in each session is around 2Kb.
4) What data does the flurry send?
The data sent by flurry includes timestamps, logged events, error logging, and the specifics of various devices
The information.
5) Does the Flurry agent support iOS os3.x?
Yes, this version (4.0.6) is a relatively comprehensive version, including for ARMv6, ARMv7, armv7s and i386 different branches of various architectures. Provides support for all versions of iOS3.1 to IOS6.
6) Which version of Xcode is required?
This flurry SDK can support Xcode4.0 and above, and if older versions are needed, please send a mailbox request support.
7) Does this version collect iOS udid information?
This version of the flurry SDK does not collect iOS Udid information.
13-flurry Mobile Statistics Tool