You can gain deep insight into your customer’s behavior very quickly and with little effort using Flurry’s Analytics service. The SDK integration process is designed to be as easy as possible with a basic setup you can complete in a short period of time.
You can use custom events to track specific actions that users take within your app – for example, making a purchase, playing a song, or sharing on Facebook. This helps you understand how users interact with your app. This page will show you how to easily capture this information by walking through a hypothetical Article Read event.
Note that this example is translatable to other actions such as Game Level Played.
Events with Two-Level Structures
Events have a two-level structure. The highest level is the specific action, in this case the reading of an article. For this example, we are naming this Event “Article Read.”
By tracking this Event, you will be able to measure how many users are reading articles, how often, and so on.
Only 1 line of code is required to track this Event:
You can track up to 300 unique Events names for each app. There is no limit on the number of times any event can be triggered across time. Once you have added Events to your app, Flurry will automatically build User Paths based on this data, so you can see how a user navigates through your app. You can also use Events to build conversion funnels and user segments.
Note that there are limitations on the number of events that can be tracked within a given session.
Capture Event Parameters
The second level in the Event structure is the Event parameter. These are characteristics of the Event itself or the user performing it. For instance, a characteristic of the Article Read event is the author of the article. A characteristic of the user is their status (i.e. registered or anonymous). Parameters let you easily view the distribution of Event characteristics so you can answer questions such as who is most read author or what percentage of users reading articles are registered?
You can capture Event parameters (which include the Event itself) with two lines of code:
string eventId = "MyEvent"; Dictionary<string, string> eventData = new Dictionary<string, string>(); eventData.Add("Age", "16"); eventData.Add("Gender", "m"); FlurryUnity.Instance.LogEvent(eventId, eventData);
Each Event can have up to 10 parameters, and each parameter can have an infinite number of values associated with it. For example, for the ‘Author’ parameter, there may be 1,000 possible authors who wrote an article. We can keep track of each author via this single parameter.
Events Best Practices
Here are a few additional best practices when implementing Events:
- Outline your business goals and the questions you want to answer, then map Events to track each action you need to measure.
- Name your Events for easy identification and categorization. If you have more than one application that has similar Events, name them the same across apps so you can more easily compare performance.
- Add Event parameters on every Event wherever applicable.
- Use timed Events wherever relevant. Flurry automatically breaks up usage into time buckets, so you can gain valuable information with little effort.
- You can always add more Events to your app. However, it will require a resubmission to your platform’s app store so that your users have a version of the app with these Events tagged.
Flurry offers a number of advanced features for developers that enable you to gain even greater insight into your users.
Use this to log the user’s assigned ID or username in your system. This should be called before init, if possible.
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.
onError to report errors that your app catches. Flurry will report the first 10 errors to occur in each session.
FlurryUnity.Instance.OnError("ERROR_NAME", "ERROR_MESSAGE", "ERROR_CLASS");
Track page views
onPageView to report page view count. To increment the total count, you should call this method whenever a new page is shown to the user.
This Page View method is different from Custom Events. If you are interested in tracking specific in-app actions (e.g. “Viewed Main Menu Screen”), you can do so using Events as discussed in Custom Events.