Time for action – registering a custom event
Add the following code to register your event. In this case the event is hardcoded as the selection of the EURUSD currency.
var flurry = require('com.onecowstanding.flurry'); flurry.logEvent('Select Currency', {key: 'EURUSD'}); flurry.endSession();
Tip
You need to call endSession
on Android to mark the end of one invocation of the app. This prevents the user from opening the app twice and it being recorded as the same session. This is not required for iOS. See the module documentation for more information and other functions at http://appcelerator.marketplace.assets.s3.amazonaws.com/downloads/4067/index.html.
What just happened?
You added code to log a custom event with Flurry. The result of the call can be seen in the following screenshot from Flurry:
Other items you can gather
Flurry allows you to gather other analysis information about your users. There are calls for collecting the users age and gender. You can also send error reports.