flurry by Trigger.io

Currently displaying version

flurry: Analytics with Flurry

The forge.flurry namespace allows you to access the native Flurry SDK, which provides usage tracking and analytics via Flurry.

Before you can use this module, you will need to have set up a Flurry application, and know its API key.

Config options

Android API Key,
iOS API Key

Platform specific API keys provided by Flurry.

By just including this configuration in your app config, basic app analytics information - such as sessions, active users and new users - will be available in your Flurry dashboard.

For more advanced analytics, you can use the API methods described below.

Debug

Enable the Flurry SDK's debug output (Optional)

API

forge.flurry.customEvent(name[, parameters], success, error)

iOS, Android

Send a named and optionally parameterised event to Flurry. You could use this to track a user's navigation through your app, for example.

Parameters:
name
string a name to identify this event
parameters
object an optional hash of extra information that will be stored with this event
success
function() callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.flurry.startTimedEvent(name[, parameters], success, error)

iOS, Android

Takes the same options as forge.flurry.customEvent, but using forge.flurry.endTimedEvent you are able to easily measure the time it takes for your users to move from one action to another in your app.

Parameters:
name
string a name to identify this event
parameters
object an optional hash of extra information that will be stored with this event
success
function() callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.flurry.endTimedEvent(name, success, error)

iOS, Android

Mark the end of a particular timed event: the name parameter should match the name parameter passed into forge.flurry.startTimedEvent.

Parameters:
name
string a name to identify this event
success
function() callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.flurry.setDemographics(demographics, success, error)

iOS, Android

Store some demographic data about the current user, to enable more advanced filtering and grouping in the Flurry dashboard.

Parameters:
demographics
object a hash optionally including values for user_id, age and gender
success
function() callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

The demographics object should contain some or all of these keys:

  • user_id: (string) a unique ID for the current user
  • age: (number) the current user's age
  • gender: (string) either "m" or "f"

forge.flurry.setLocation(coords, success, error)

iOS, Android

Set the user's current location: we recommend you use the forge.geolocation.getCurrentPosition to grab the coords object which should be passed in.

Parameters:
coords
object a hash representing location - must include latitude, longitude and accuracy
success
function() callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

Example:

forge.geolocation.getCurrentPosition(function (position) {
    forge.flurry.setLocation(position.coords);
});